pax_global_header00006660000000000000000000000064130220310070014476gustar00rootroot0000000000000052 comment=433aa8e8df5bed1e9f03d8c5c567512a3f3bb138 nsca-2.9.2/000077500000000000000000000000001302203100700124345ustar00rootroot00000000000000nsca-2.9.2/.gitignore000066400000000000000000000003521302203100700144240ustar00rootroot00000000000000Makefile config.log config.status init-script autom4te.cache/ include/config.h nbproject/ package/solaris/Makefile sample-config/nsca.cfg sample-config/nsca.xinetd sample-config/send_nsca.cfg src/Makefile src/nsca src/send_nsca subst nsca-2.9.2/Changelog000066400000000000000000000110371302203100700142500ustar00rootroot00000000000000************** NSCA Changelog ************** 2.9.2 - 2016-12-07 ------------------ - Renamed configure.in to configure.ac and added check for sigaction (John Frickson) - Replaced all instances of signal() with sigaction() + blocking (John Frickson) - Race condition when opening command file (mvela / John Frickson) - Fix missing argument in open calls (Xavier Bachelot / John Frickson) - NSCA close/POLLNVAL/accept bug causes hang (mib / John Frickson) 2.9.1 - 01/27/2012 ------------------ - Applied patch to allow packets arriving with a future time stamp (Daniel Wittenberg) - Updated server (nsca) to allow packets with older, smaller packet size (Eric Stanley) 2.9 - 11/04/2011 ---------------- - Add config directive to submit directly to checkresults directory (Mike Lindsey) - Support multi-line check output with 4000 character limit (Mike Lindsey) 2.8 - ??/??/???? ---------------- - Added --with-log-facility option to control syslog logging (Ryan Ordway and Brian Seklecki) - Fixed bug where daemon would segfault if mcrypt library was not initialized before timeout (Holger Weiss) - Fixed bug with switching from dump file to command file when running under single mode (Ton Voon) - Fix for small memory leak with running as a single process daemon (Daniel) 2.7.2 - 07/03/2007 ------------------ - Fixed bug with NSCA daemon eating CPU if child process couldn't accept a connection in multi-process mode (Chris Wilson) 2.7.1 - 01/29/2007 ------------------ - Fixed bug that prevented single mode daemon from working properly - Added sample scripts for testing functionality to nsca_tests/ (Ton Voon/Altinity) 2.7 - 12/13/2006 ---------------- - Fixed crash from malformed command line - Updated to config.sub and config.guess to latest from GNU Savannah 2.6 - 04/06/2006 ---------------- - Spec file fix - Segfault fix in encryption library cleanup - Daemon now exits with an error if it can't drop privileges - Added chroot support (Sean Finney) - Added support for writing a PID file - Added support for reloading config files with SIGHUP 2.5 - 01/21/2006 ---------------- - Native TCP wrapper support in daemon mode - Memory leak fix and cleanup (Mark Ferlatte) - Compiler warning fix (David Binderman) - max_packet_age=0 will disable packet timestamp checks - New config.sub and config.guess for checking local system type 2.4 - 07/23/2003 ---------------- - Better support for u_int32_t detection - Minor bug fixes 2.3 - 01/26/2003 ---------------- - Minor changes to daemon init code - Minor Makefile fixes 2.2 - 01/08/2002 ---------------- - Hopefully better support for Solaris (u_int32_t) - Syntax changes for command line arguments - Added support for passive host checks (supported only in Nagios 2.x and later) - Added sample xinetd config file (nsca.xinetd) - Minor mods and bug fixes 2.1 - 06/10/2002 ---------------- - Fix for compiling under Solaris (Scott Cokely) - Added setuid/setgid option to config file 2.0 - 02/21/2002 ---------------- - Name and version change 1.2.0 - 02/12/2002 ------------------ - Compatability between older versions has been broken! - Server now sends client IV and timestamp, fixing encryption problems and making it more resistent to "replay" attacks (Ralf Ertzinger) - Random IV is now seeded from /dev/urandom instead of time() if possible - Added directions on running under xinetd to README - Implemented Beej's sendall() to handle incomplete send()s - Added single-mode daemon code (David Luyer) - Fixed problem with aggregated writes (David Luyer) - Better autoconf detection of libmcrypt (Jay McCarthy) - Added ability to dump check results to alternate dump file if command file does not exist (i.e. NetSaint is not running) - Removed some old crud 1.1.2 - 09/22/2001 ------------------ - Added append_to_file option to allow for opening the command file in either write or append mode - Explicit integer size in packet structure - NULL IV is used for both encryption/decryption. This leaves the daemon open to "replay" attacks, but will disappear in future revisions when IV negotiation between the client and daemon is implemented. 1.1.1 - 04/26/2001 ------------------ - Configure script bug fix 1.1.0 - 02/24/2001 ------------------ - Added encryption routines (using libmcrypt) - Minor code enhancements/cleanups 1.0b3 - 12/21/2000 ------------------ - Removed lock file code, as 0.0.7 uses a named pipe - Documented aggregated_writes option 1.0b2 - 08/26/2000 ------------------ - Added option to use write lock when updating external command file 1.0b1 - 04/17/2000 ------------------ - Initial cut nsca-2.9.2/LEGAL000066400000000000000000000006641302203100700132110ustar00rootroot00000000000000 All source code, binaries, documentation, and information contained in this distribution are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Nagios and the Nagios logo are registered trademarks of Ethan Galstad. All other trademarks, servicemarks, registered trademarks, and registered servicemarks are the property of their respective owner(s). nsca-2.9.2/Makefile.in000066400000000000000000000026641302203100700145110ustar00rootroot00000000000000############################### # Makefile for NSCA # # Last Modified: 10-15-2003 ############################### # Source code directories SRC_BASE=./src/ SRC_INCLUDE=./include/ all: cd $(SRC_BASE); $(MAKE) $@ ; cd .. @echo "" @echo "*** Compile finished ***" @echo "" @echo "If the compile finished without any errors, you should" @echo "find client and server binaries in the src/ subdirectory." @echo "" @echo "Read the README file for more information on installing" @echo "the binaries, creating configuration files, and using" @echo "the server and client." @echo "" nsca: cd $(SRC_BASE); $(MAKE) $@ ; cd .. send_nsca: cd $(SRC_BASE); $(MAKE) $@ ; cd .. install: @echo "" @echo "Read the README file for information on installing the" @echo "client and server binaries." @echo "" solaris-package: @if [ `uname -s` != "SunOS" ] ; then \ echo "It is recommended you be running on Solaris to build a Solaris package"; \ else \ cd package/solaris; $(MAKE) build ; $(MAKE) pkg ; cd ../..; \ fi clean: cd $(SRC_BASE); $(MAKE) $@ ; cd .. cd package/solaris; $(MAKE) $@ ; cd ../.. rm -f core rm -f *~ */*~ distclean: clean cd $(SRC_BASE); $(MAKE) $@ ; cd .. cd package/solaris; $(MAKE) $@ ; cd ../.. rm -f conf.libmcrypttest config.log config.status config.cache init-script Makefile subst $(SRC_INCLUDE)config.h rm -f sample-config/nsca.cfg sample-config/send_nsca.cfg sample-config/nsca.xinetd devclean: distclean nsca-2.9.2/README000066400000000000000000000156721302203100700133270ustar00rootroot00000000000000*********** NSCA README *********** Purpose ------- The purpose of this addon is to allow you to send service check results to a central monitoring server running Nagios in a secure manner. Contents -------- There are two pieces to this addon: 1) nsca - This program runs as a daemon on the central server that runs Nagios. It listens for host and service check results from remote machines (sent using the send_nsca program described below). Upon receiving data from a remote client, the daemon will make a *very* basic attempt at validating the data it has received from the client. This is done by decrypting the data with the password stored in the nsca.cfg file. If the decrypted data looks okay (i.e. it was originally encrypted by the send_ncsa program using the same password), the daemon will make entries in the Nagios external command file telling Nagios to process the host or service check result. Notes: The nsca daemon must have sufficient rights to open the Nagios command file for writing. Also, Nagios will only process passive service check results that it finds in the external command file if the service has been defined in the host config file (i.e. hosts.cfg) and it is being monitored. 2) send_nsca - This is the client program that is used to send service check information from a remote machine to the nsca daemon on the central machine that runs Nagios. Service check information is read from the standard input in tab-delimited format as follows: [tab][tab][tab][newline] where: =short name of host that the service is associated with =description of the service =numeric return code =output from service check Host check information is submitted in a similiar fashion - just leave out the service description: [tab][tab][newline] Compiling --------- The code is very basic and may not work on your particular system without some tweaking. I just haven't put a lot of effort into this addon. Most users should be able to compile the daemon and client piece with the following commands... ./configure make all The binaries will be located in the src/ directory after you run 'make all' and will have to be installed manually. Installing ---------- The send_nsca program and associate config file (nsca.cfg) should be placed on remote machines that you want to have communicate with the nsca daemon. This means that you may have to compile the send_nsca program on the remote machine, if its not the same OS/architecture as that of the central server. The nsca daemon and the configuration file (nsca.cfg) should be placed somewhere on the central server running Nagios. NOTES: Make sure that you specify and use the same password in both the nsca.cfg and send_nsca.cfg files! If you use a different password to encrypt the data than you do to decrypt it, the nsca daemon will reject the data you send it. Security -------- There are some security implications with allowing remote clients to provide service check results to Nagios. Because of this, you have the option of encrypting the packets that the NSCA client sends to the NSCA daemon. Read the SECURITY file for more information on the security risks of running NSCA, along with an explanation of what kind of protection the encryption provides you. Running Under INETD or XINETD ----------------------------- If you plan on running nsca under inetd or xinetd and making use of TCP wrappers, you need to do the following things: 1) Add a line to your /etc/services file as follows (modify the port number as you see fit) nsca 5667/tcp # NSCA 2) Add entries for the NSCA daemon to either your inetd or xinetd configuration files. Which one your use will depend on which superserver is installed on your system. Both methods are described below. NOTE: If you run nsca under inetd or xinetd, the server_port and allowed_hosts variables in the nrpe configuration file are ignored. ***** INETD ***** If your system uses the inetd superserver WITH tcpwrappers, add an entry to /etc/inetd.conf as follows: nsca stream tcp nowait /usr/sbin/tcpd -c --inetd If your system uses the inetd superserver WITHOUT tcpwrappers, add an entry to /etc/inetd.conf as follows: nsca stream tcp nowait -c --inetd - Replace with the name of the user that nsca server should run as. Example: nagios - Replace with the path to the nsca binary on your system. Example: /usr/local/nagios/nsca - Replace with the path to the nsca config file on your system. Example: /usr/local/nagios/nsca.cfg ***** XINETD ***** If your system uses xinetd instead of inetd, you'll probably want to create a file called 'nsca' in your /etc/xinetd.d directory that contains the following entries (a sample config file called nsca.xinetd should be created in the root folder of the distribution after you run the configure script): # default: on # description: NSCA service nsca { flags = REUSE socket_type = stream wait = no user = group = server = server_args = -c --inetd log_on_failure += USERID disable = no only_from = ... } - Replace with the name of the user that the nsca server should run as. - Replace with the name of the group that the nsca server should run as. - Replace with the path to the nsca binary on your system. - Replace with the path to the nsca config file on your system. - Replace the fields with the IP addresses of hosts which are allowed to connect to the NSCA daemon. This only works if xinetd was compiled with support for tcpwrappers. 3) Restart inetd or xinetd will the following command (pick the one that is appropriate for your system: /etc/rc.d/init.d/inet restart /etc/rc.d/init.d/xinetd restart 4) Add entries to your /etc/hosts.allow and /etc/hosts.deny file to enable TCP wrapper protection for the nsca service. This is optional, although highly recommended. Questions? ---------- If you have questions about this addon, or problems getting things working, send an email to one of the nagios mailing lists (see http://support.nagios.com). -- Ethan Galstad nsca-2.9.2/SECURITY000066400000000000000000000151001302203100700136230ustar00rootroot00000000000000******************** NSCA SECURITY README ******************** General Security Considerations ------------------------------- Before you proceed with installing the NSCA daemon daemon on your monitoring server, there are some security implications that you should be aware of. The main thing you need to be aware of is the fact that malicious users could potentionally use the NSCA client to send fake service and host check results to the NSCA daemon (and thus Nagios). This is bad for two reasons: 1) Nagios could get fake check results and start generating notifications (which would annoy you) or host/service problems (like security alerts) could be cleared by the remote user. 2) Worse, since Nagios can be configured to run event handlers for hosts and services, a remote user could indirectly cause Nagios to shut down or restart a service (or do something more serious). Running the NSCA daemon under inetd and making use of TCP wrappers allows you to perform some host-based authentication of clients. That isn't really good enough, as any user on a blessed client machine could use the client to send fake check results to the daemon (and thus to Nagios). So what's the solution? Encryption. Encrypting Communications ------------------------- In order to avoid some of the security hassles associated with allowing remote clients to provide Nagios with host and service check results, we can encrypt the data being sent from the client to the NSCA daemon. While encryption is good because it provides some privacy as to the information that is being sent from the client to the daemon, the main purpose of the encryption is to provide the daemon with a way of authenticating the client and seeing if they're authorized to provide check results. Basically the daemon says: "Hey, if you (the client) used the same password and algorithm to encrypt the data as I use to decrypt it, I'll accept the check results you're providing me..." How The Authentication Works ---------------------------- Authentication of checks results works as follows: 1) The user starts the NSCA client and passes the host and/or service check results to it. A password that is used to encrypt the data being sent to the NSCA daemon is stored in the send_nsca config file on the client machine. 2) The NSCA client stuff the check results into a packet (or several packets if you send multiple results). 3) The NSCA client computes the CRC-32 value of the packet its about to send off and stores that value in the packet body. 4) The entire packet body (including the service checking information, as well as the CRC-32 value) is encrypted using the password stored in the send_nsca.cfg file. Encryption of the packet is done using the algorithm specified by the encryption_method variable in the send_nsca.cfg file. ... packet gets sent over the wire... 5) The NSCA daemon recieves the packet and decrypts it using the password stored in the nsca.cfg file. Decryption of the packet is done using the algorithm specified by the decryption_method variable in the nsca.cfg file. 6) The daemon calculates the CRC-32 value of the decrypted packet to see if it matches the CRC-32 value stored in the packet body (this value was previously computed and stored by the client). 7) If the calculated CRC-32 value matches the value that is stored in the packet body, the service check results that are stored in the packet are assumed to be from an authorized user. If the calculated CRC-32 value does NOT match the value in the packet body, the results are assumed to be from an unauthorized user and the packet (and the host or service check results contained therein) are discarded. What This Means --------------- 1) If the client uses the wrong password to encrypt the packet, the daemon will discard it, as the CRC-32 value stored in the packet will not match the computed value once the packet it decrypted. 2) If the client uses the wrong encryption method, the daemon will discard the results, as the CRC-32 value stored in the packet will not match the computed value once the packet is decrypted. 3) If someone tries to dabble with the contents of the packet as it is being tranferred between the client and the server, the daemon will likely discard the packet, as the CRC-32 value of the packet will likely be invalid. 4) Even if someone manages to figure out a way to make the calculated CRC-32 value match the value stored in the packet, the check results stored in the packet that are passed along to Nagios have to match a valid host or service definition. Nagios ignores all passive check results that come in that are not associated with any valid host or service definitions. Preventing "Replay" Attacks --------------------------- The methods described above help ensure that the data the NSCA daemon receives is "valid" data - i.e., it was encrypted with the appropriate passphrase and crypto algorithm. One problem that remains is the fact that someone could capture the data packets being sent from the client to the daemon and send them back to the daemon at a later time. This is referred to as a "replay attack". To help prevent this, the NSCA daemon generates what is essentially a one-time, randomly generated IV that the client must use to encrypt data for each particular "session". The IV does not need to be secret, just unique. The IV is used in conjunction with the password during encryption and decryption. Encrypting a packet with the same password but different IVs results in a different result. Since the daemon knows what IV it generated and sent to the client, it can verify that the data the client sends to it has been properly encrypted. This provides a reasonable mechanism of preventing replay attacks. Caveats ------- 1) These assumptions rely on the fact that you are using a reasonably secure encryption/decryption method in the NSCA clients and NSCA daemon. 2) These assumptions rely on the fact that you're using a resonable secure password to encrypt/decrypt the data. Depending on the crypto algorithm used, this could mean length and/or randomness. As a general rule, longer passwords or passphrases are better than shorter ones. Insert common sense here. 3) It is assumed that you keep tight security on the send_nsca.cfg and nsca.cfg config files, as they contain both the algorithm and password used to encrypt/decrypt the packets sent between the client and daemon. Questions? Comments? Suggestions? -- Ethan Galstad (nagios@nagios.org) nsca-2.9.2/aclocal.m4000066400000000000000000000215701302203100700143010ustar00rootroot00000000000000dnl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. dnl Autoconf macros for libmcrypt dnl $id$ # This script detects libmcrypt version and defines # LIBMCRYPT_CFLAGS, LIBMCRYPT_LIBS # and LIBMCRYPT24 or LIBMCRYPT22 depending on libmcrypt version # found. # Modified for LIBMCRYPT -- nmav # Configure paths for LIBGCRYPT # Shamelessly stolen from the one of XDELTA by Owen Taylor # Werner Koch 99-12-09 dnl AM_PATH_LIBMCRYPT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libmcrypt, and define LIBMCRYPT_CFLAGS and LIBMCRYPT_LIBS dnl AC_DEFUN(AM_PATH_LIBMCRYPT, [dnl dnl Get the cflags and libraries from the libmcrypt-config script dnl AC_ARG_WITH(libmcrypt-prefix, [ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)], libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="") if test x$libmcrypt_config_prefix != x ; then libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix" if test x${LIBMCRYPT_CONFIG+set} != xset ; then LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config fi fi AC_PATH_PROG(LIBMCRYPT_CONFIG, libmcrypt-config, no) min_libmcrypt_version=ifelse([$1], ,2.4.0,$1) AC_MSG_CHECKING(for libmcrypt - version >= $min_libmcrypt_version) no_libmcrypt="" if test "$LIBMCRYPT_CONFIG" = "no" ; then dnl libmcrypt-config was not found (pre 2.4.11 versions) dnl Try to detect libmcrypt version AC_TRY_RUN([ #include #include #include #include int main () { #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ return 0; #else /* version 2.4 */ return 1; #endif /* 19991015 */ } ], libmcrypt_config_version="2.2.0" if test x$libmcrypt_config_prefix != x ; then TTLIBS="-L${libmcrypt_config_prefix}/libs" TTINCLUDE="-I${libmcrypt_config_prefix}/include" fi LIBMCRYPT_CFLAGS="${TTINCLUDE}" LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt" AC_DEFINE(LIBMCRYPT22) , libmcrypt_config_version="2.4.0" if test x$libmcrypt_config_prefix != x ; then TTLIBS="-L${libmcrypt_config_prefix}/libs" TTINCLUDE="-I${libmcrypt_config_prefix}/include" fi LIBMCRYPT_CFLAGS="${TTINCLUDE}" LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" AC_DEFINE(LIBMCRYPT24)) else dnl libmcrypt-config was found LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags` LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs` libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version` AC_DEFINE(LIBMCRYPT24) fi ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" LIBS="$LIBS $LIBMCRYPT_LIBS" dnl dnl Now check if the installed libmcrypt is sufficiently new. Also sanity dnl checks the results of libmcrypt-config to some extent dnl rm -f conf.libmcrypttest AC_TRY_RUN([ #include #include #include #include #define TWO "2.2" int main () { #if MCRYPT_API_VERSION <= 20010201 #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); system ("touch conf.libmcrypttest"); if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) { printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n", "$min_libmcrypt_version", TWO ); printf("*** was found!\n"); return 1; } return 0; #else /* version 2.4 before 11 */ MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); system ("touch conf.libmcrypttest"); mcrypt_module_close(td); return 0; #endif /* 19991015 */ #else system ("touch conf.libmcrypttest"); if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) ) { printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n", "$libmcrypt_config_version", mcrypt_check_version(NULL) ); printf("*** was found! If libmcrypt-config was correct, then it is best\n"); printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n"); printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) ) { printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION); printf("*** library (version %s)\n", mcrypt_check_version(NULL) ); } else { if ( mcrypt_check_version( "$min_libmcrypt_version" ) ) { return 0; } else { printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n", mcrypt_check_version(NULL) ); printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n", "$min_libmcrypt_version" ); printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n"); printf("*** \n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n"); printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; #endif /* 20010201 */ } ],, no_libmcrypt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" if test "x$no_libmcrypt" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else if test -f conf.libmcrypttest ; then : else AC_MSG_RESULT(no) fi if test -f conf.libmcrypttest ; then : else echo "*** Could not run libmcrypt test program, checking why..." CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" LIBS="$LIBS $LIBMCRYPT_LIBS" AC_TRY_LINK([ #include #include #include #include ], [ #if MCRYPT_API_VERSION <= 20010201 #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); return 0; #else /* version 2.4 before 11 */ MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); mcrypt_module_close(td); return 0; #endif /* 19991015 */ #else return !!mcrypt_check_version(NULL); #endif /* 20010201 */ ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong" echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed" echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you" echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi LIBMCRYPT_CFLAGS="" LIBMCRYPT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(LIBMCRYPT_CFLAGS) AC_SUBST(LIBMCRYPT_LIBS) ]) dnl *-*wedit:notab*-* Please keep this as the last line. nsca-2.9.2/config.guess000077500000000000000000001267031302203100700147650ustar00rootroot00000000000000#! /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 Free Software Foundation, # Inc. timestamp='2006-12-08' # 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 to . Submit a context # diff and a properly formatted 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. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. 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 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 __ELF__ >/dev/null 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 ;; 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:SunOS:5.*:*) echo i386-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:*:[45]) 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 __LP64__ >/dev/null 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 ;; i*: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 ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-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 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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 ;; 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:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu 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 ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 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 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-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 xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) 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 i386. echo i386-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; } ;; 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.0*:*) 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 ;; 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 ;; 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 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 ;; 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: nsca-2.9.2/config.sub000077500000000000000000000775531302203100700144400ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-12-08' # 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 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. # 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 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* | \ 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) os= basic_machine=$1 ;; -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 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | 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 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # 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-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | 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-* \ | sh-* | sh[1234]-* | sh[24]a-* | 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-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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 ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; 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 ;; cr16c) basic_machine=cr16c-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 ;; 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 ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; 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 ;; 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 ;; 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 ;; 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[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. -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* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -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* \ | -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*) # 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 ;; -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 ;; 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 ;; -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: nsca-2.9.2/configure000077500000000000000000005402201302203100700143460ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for nsca 2.9.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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. as_myself= 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 # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} 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 test -x / || 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 : export CONFIG_SHELL # 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 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 and $0: nagios-users@lists.sourceforge.net 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_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_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; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 as_test_x='test -x' as_executable_p=as_fn_executable_p # 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'" 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='nsca' PACKAGE_TARNAME='nsca' PACKAGE_VERSION='2.9.2' PACKAGE_STRING='nsca 2.9.2' PACKAGE_BUGREPORT='nagios-users@lists.sourceforge.net' PACKAGE_URL='http://www.nagios.org' ac_unique_file="src/nsca.c" ac_default_prefix=/usr/local/nagios # 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='LTLIBOBJS LIBOBJS PERL TARGET_PLATFORM TARGET_ARCH TARGET_OS TARGET_VER nsca_port nsca_grp nsca_user log_facility LIBMCRYPT_LIBS LIBMCRYPT_CFLAGS LIBMCRYPT_CONFIG LIBWRAPLIBS SOCKETLIBS EGREP GREP CPP SET_MAKE OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build INSTALL INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM PKG_REL_DATE PKG_HOME_URL PKG_VERSION PKG_NAME 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 with_mcrypt_lib with_mcrypt_inc with_libmcrypt_prefix with_log_facility with_nsca_user with_nsca_grp with_nsca_port ' 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_TARNAME}' 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 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 nsca 2.9.2 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/nsca] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF 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 case $ac_init_help in short | recursive ) echo "Configuration of nsca 2.9.2:";; esac cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-mcrypt-lib=DIR sets location of the mcrypt client library --with-mcrypt-inc=DIR sets location of the mcrypt client include files --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional) --with-log-facility= sets NSCA syslog facility --with-nsca-user= sets user name to run NSCA --with-nsca-grp= sets group name to run NSCA --with-nsca-port= sets port number for NSCA to listen on 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 . nsca home page: . _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 nsca configure 2.9.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_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; ${as_lineno_stack:+:} 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # 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 \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; 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;} ( $as_echo "## ------------------------------------------------- ## ## Report this to nagios-users@lists.sourceforge.net ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &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 || 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 nsca $as_me 2.9.2, which was generated by GNU Autoconf 2.69. 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 # 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 include/config.h" ac_config_files="$ac_config_files Makefile subst src/Makefile package/solaris/Makefile init-script sample-config/nsca.cfg sample-config/send_nsca.cfg sample-config/nsca.xinetd" PKG_NAME=nsca PKG_VERSION="2.9.2" PKG_HOME_URL="http://www.nagios.org/" PKG_REL_DATE="12-07-2016" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$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. # 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 ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$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' # 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 ${ac_cv_build+:} false; 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 ${ac_cv_host+:} false; 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_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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_objext+:} false; 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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 struct stat; /* 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 { $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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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 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 ${ac_cv_prog_CPP+:} false; 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 grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; 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" as_fn_executable_p "$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 ${ac_cv_path_EGREP+:} false; 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" as_fn_executable_p "$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 ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; 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 { $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 ${ac_cv_header_time+:} false; 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 for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=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_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 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 db.h ctype.h errno.h fcntl.h grp.h inttypes.h netdb.h pwd.h regex.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h sys/config.h sys/int_types.h sys/poll.h sys/types.h sys/time.h sys/resource.h sys/socket.h sys/stat.h sys/wait.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 an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* 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 sort of thing. */ char tx; char *t = &tx; 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 sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=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_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t 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" = xyes; 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" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5 $as_echo_n "checking type of array argument to getgroups... " >&6; } if ${ac_cv_type_getgroups+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_type_getgroups=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ $ac_includes_default #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { gid_t gidset[NGID]; int i, n; union { gid_t gval; long int lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) gidset[i] = val.gval; n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short int but getgroups modifies an array of ints. */ return n > 0 && gidset[n] != val.gval; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_type_getgroups = cross; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then : ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_getgroups" >&5 $as_echo "$ac_cv_type_getgroups" >&6; } cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $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 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : else if test "$ac_cv_type_short" = yes; then { { $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 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $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 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" if test "x$ac_cv_type_uint32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define uint32_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default" if test "x$ac_cv_type_u_int32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define u_int32_t unsigned int _ACEOF fi if test "$ac_cv_type_u_int32_t" = no ; then if test "$ac_cv_type_u_int32_t" = yes ; then $as_echo "#define U_INT32_T_IS_UINT32_T 1" >>confdefs.h else if test "$ac_cv_sizeof_int" = 4 ; then $as_echo "#define U_INT32_T_IS_UINT 1" >>confdefs.h else if test "$ac_cv_sizeof_long" = 4 ; then $as_echo "#define U_INT32_T_IS_ULONG 1" >>confdefs.h else if test "$ac_cv_sizeof_short" = 4 ; then $as_echo "#define U_INT32_T_IS_USHORT 1" >>confdefs.h fi fi fi fi fi ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" if test "x$ac_cv_type_int32_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define int32_t int _ACEOF fi if test "$ac_cv_type_int32_t" = no ; then if test "$ac_cv_sizeof_int" = 4 ; then $as_echo "#define INT32_T_IS_UINT 1" >>confdefs.h else if test "$ac_cv_sizeof_long" = 4 ; then $as_echo "#define INT32_T_IS_ULONG 1" >>confdefs.h else if test "$ac_cv_sizeof_short" = 4 ; then $as_echo "#define INT32_T_IS_USHORT 1" >>confdefs.h fi fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if ${ac_cv_lib_nsl_main+:} false; 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" = xyes; then : SOCKETLIBS="$SOCKETLIBS -lnsl" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; 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" = xyes; then : SOCKETLIBS="$SOCKETLIBS -lsocket" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwrap" >&5 $as_echo_n "checking for main in -lwrap... " >&6; } if ${ac_cv_lib_wrap_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwrap $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_wrap_main=yes else ac_cv_lib_wrap_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_wrap_main" >&5 $as_echo "$ac_cv_lib_wrap_main" >&6; } if test "x$ac_cv_lib_wrap_main" = xyes; then : LIBWRAPLIBS="$LIBWRAPLIBS -lwrap" $as_echo "#define HAVE_LIBWRAP 1" >>confdefs.h fi for ac_func in strdup strstr strtoul sigaction 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 ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" " #if HAVE_SIGNAL_H #include #endif " if test "x$ac_cv_type_sig_atomic_t" = xyes; then : else $as_echo "#define sig_atomic_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include " if test "x$ac_cv_type_socklen_t" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 $as_echo_n "checking for socklen_t equivalent... " >&6; } if ${curl_cv_socklen_t_equiv+:} false; then : $as_echo_n "(cached) " >&6 else # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int getpeername (int, $arg2 *, $t *); int main () { $t len; getpeername(0,0,&len); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : curl_cv_socklen_t_equiv="$t" break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done if test "x$curl_cv_socklen_t_equiv" = x; then as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $curl_cv_socklen_t_equiv" >&5 $as_echo "$curl_cv_socklen_t_equiv" >&6; } cat >>confdefs.h <<_ACEOF #define socklen_t $curl_cv_socklen_t_equiv _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket size" >&5 $as_echo_n "checking for type of socket size... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { int a = send(1, (const void *)0, (size_t *) 0, (int *) 0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define SOCKET_SIZE_TYPE size_t" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t" >&5 $as_echo "size_t" >&6; } else $as_echo "#define SOCKET_SIZE_TYPE int" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5 $as_echo "int" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check whether --with-mcrypt-lib was given. if test "${with_mcrypt_lib+set}" = set; then : withval=$with_mcrypt_lib; LDFLAGS="${LDFLAGS} -L${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" fi # Check whether --with-mcrypt-inc was given. if test "${with_mcrypt_inc+set}" = set; then : withval=$with_mcrypt_inc; CFLAGS="${CFLAGS} -I${withval}" fi MCRYPTLIBFOUND=yep # Check whether --with-libmcrypt-prefix was given. if test "${with_libmcrypt_prefix+set}" = set; then : withval=$with_libmcrypt_prefix; libmcrypt_config_prefix="$withval" else libmcrypt_config_prefix="" fi if test x$libmcrypt_config_prefix != x ; then libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix" if test x${LIBMCRYPT_CONFIG+set} != xset ; then LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config fi fi # Extract the first word of "libmcrypt-config", so it can be a program name with args. set dummy libmcrypt-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 ${ac_cv_path_LIBMCRYPT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $LIBMCRYPT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBMCRYPT_CONFIG="$LIBMCRYPT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBMCRYPT_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 test -z "$ac_cv_path_LIBMCRYPT_CONFIG" && ac_cv_path_LIBMCRYPT_CONFIG="no" ;; esac fi LIBMCRYPT_CONFIG=$ac_cv_path_LIBMCRYPT_CONFIG if test -n "$LIBMCRYPT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBMCRYPT_CONFIG" >&5 $as_echo "$LIBMCRYPT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_libmcrypt_version=2.4.11 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmcrypt - version >= $min_libmcrypt_version" >&5 $as_echo_n "checking for libmcrypt - version >= $min_libmcrypt_version... " >&6; } no_libmcrypt="" if test "$LIBMCRYPT_CONFIG" = "no" ; then if test "$cross_compiling" = yes; then : { { $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 test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ return 0; #else /* version 2.4 */ return 1; #endif /* 19991015 */ } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libmcrypt_config_version="2.2.0" if test x$libmcrypt_config_prefix != x ; then TTLIBS="-L${libmcrypt_config_prefix}/libs" TTINCLUDE="-I${libmcrypt_config_prefix}/include" fi LIBMCRYPT_CFLAGS="${TTINCLUDE}" LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt" $as_echo "#define LIBMCRYPT22 1" >>confdefs.h else libmcrypt_config_version="2.4.0" if test x$libmcrypt_config_prefix != x ; then TTLIBS="-L${libmcrypt_config_prefix}/libs" TTINCLUDE="-I${libmcrypt_config_prefix}/include" fi LIBMCRYPT_CFLAGS="${TTINCLUDE}" LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" $as_echo "#define LIBMCRYPT24 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags` LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs` libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version` $as_echo "#define LIBMCRYPT24 1" >>confdefs.h fi ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" LIBS="$LIBS $LIBMCRYPT_LIBS" rm -f conf.libmcrypttest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #define TWO "2.2" int main () { #if MCRYPT_API_VERSION <= 20010201 #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); system ("touch conf.libmcrypttest"); if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) { printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n", "$min_libmcrypt_version", TWO ); printf("*** was found!\n"); return 1; } return 0; #else /* version 2.4 before 11 */ MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); system ("touch conf.libmcrypttest"); mcrypt_module_close(td); return 0; #endif /* 19991015 */ #else system ("touch conf.libmcrypttest"); if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) ) { printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n", "$libmcrypt_config_version", mcrypt_check_version(NULL) ); printf("*** was found! If libmcrypt-config was correct, then it is best\n"); printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n"); printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) ) { printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION); printf("*** library (version %s)\n", mcrypt_check_version(NULL) ); } else { if ( mcrypt_check_version( "$min_libmcrypt_version" ) ) { return 0; } else { printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n", mcrypt_check_version(NULL) ); printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n", "$min_libmcrypt_version" ); printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n"); printf("*** \n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n"); printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; #endif /* 20010201 */ } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_libmcrypt=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" if test "x$no_libmcrypt" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else if test -f conf.libmcrypttest ; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -f conf.libmcrypttest ; then : else echo "*** Could not run libmcrypt test program, checking why..." CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" LIBS="$LIBS $LIBMCRYPT_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { #if MCRYPT_API_VERSION <= 20010201 #if MCRYPT_API_VERSION <= 19991015 /* version 2.2 */ int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); return 0; #else /* version 2.4 before 11 */ MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); mcrypt_module_close(td); return 0; #endif /* 19991015 */ #else return !!mcrypt_check_version(NULL); #endif /* 20010201 */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong" echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed" echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you" echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi LIBMCRYPT_CFLAGS="" LIBMCRYPT_LIBS="" MCRYPTLIBFOUND=nope fi if test $MCRYPTLIBFOUND = yep; then CFLAGS="${CFLAGS} -DHAVE_LIBMCRYPT ${LIBMCRYPT_CFLAGS}" LDFLAGS="${LDFLAGS} ${LIBMCRYPT_LIBS}" fi if test x$MCRYPTLIBFOUND = xnope; then echo "" echo "" echo "**************************************************************" echo "MCRYPT LIBRARY (libmcrypt) COULD NOT BE LOCATED..." echo "" echo "The mcrypt library could not be located on your system. This" echo "means that you will NOT be able to use any crypto algorithms" echo "in the NSCA client or daemon." echo "" echo "Read the SECURITY text file for more information on why" echo "encryption is important to ensuring that the NSCA daemon is" echo "not abused by malicious users." echo "" echo "You can download libmcrypt from:" echo "" echo " http://mcrypt.sourceforge.net/" echo "" echo "" echo "NOTE: After you install the MCRYPT library on your system:" echo "" echo " 1. Make sure /etc/ld.so.conf has an entry for the" echo " directory in which the MCRYPT library is installed." echo " 2. Run 'ldconfig' to update the run-time linker options." echo " 3. Run 'make devclean' in the NSCA distribution to clean" echo " out any old references to your previous compile." echo " 4. Rerun the configure script." echo "" echo "**************************************************************" echo "" fi # Check whether --with-log_facility was given. if test "${with_log_facility+set}" = set; then : withval=$with_log_facility; log_facility=$withval else log_facility=daemon fi cat >>confdefs.h <<_ACEOF #define NSCA_LOG_FACILITY "$log_facility" _ACEOF # Check whether --with-nsca_user was given. if test "${with_nsca_user+set}" = set; then : withval=$with_nsca_user; nsca_user=$withval else nsca_user=nagios fi # Check whether --with-nsca_grp was given. if test "${with_nsca_grp+set}" = set; then : withval=$with_nsca_grp; nsca_grp=$withval else nsca_grp=nagios fi # Check whether --with-nsca_port was given. if test "${with_nsca_port+set}" = set; then : withval=$with_nsca_port; nsca_port=$withval else nsca_port=5667 fi cat >>confdefs.h <<_ACEOF #define DEFAULT_SERVER_PORT $nsca_port _ACEOF # Determine target OS, version and architecture for package build macros if test "x$target_ver" = "x" ; then TARGET_VER=`uname -r` else TARGET_VER=$target_ver fi if test "x$target_os" = "x" ; then TARGET_OS=`uname -s` else TARGET_OS=$target_os fi if test "x$target_cpu" = "x" ; then TARGET_ARCH=`uname -p` else TARGET_ARCH=$target_cpu fi TARGET_PLATFORM="" if test "x$TARGET_OS" = "xSunOS" ; then if test "x$TARGET_VER" = "x5.10" ; then TARGET_PLATFORM="sol10" fi fi # 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 ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$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=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 : "${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. as_myself= 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 nsca $as_me 2.9.2, which was generated by GNU Autoconf 2.69. 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" _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 Report bugs to . nsca home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ nsca config.status 2.9.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' 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 _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 "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "subst") CONFIG_FILES="$CONFIG_FILES subst" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "package/solaris/Makefile") CONFIG_FILES="$CONFIG_FILES package/solaris/Makefile" ;; "init-script") CONFIG_FILES="$CONFIG_FILES init-script" ;; "sample-config/nsca.cfg") CONFIG_FILES="$CONFIG_FILES sample-config/nsca.cfg" ;; "sample-config/send_nsca.cfg") CONFIG_FILES="$CONFIG_FILES sample-config/send_nsca.cfg" ;; "sample-config/nsca.xinetd") CONFIG_FILES="$CONFIG_FILES sample-config/nsca.xinetd" ;; *) 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 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_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 -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # 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 {' >"$ac_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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; 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 " 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="$ac_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 >"$ac_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 _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 $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_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' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_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 "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_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 "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; 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 perl subst init-script perl subst sample-config/nsca.xinetd perl subst sample-config/nsca.cfg perl subst sample-config/send_nsca.cfg echo "" echo "" { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" >&5 $as_echo "*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" >&6; } echo "" echo " General Options:" echo " -------------------------" { $as_echo "$as_me:${as_lineno-$LINENO}: result: NSCA port: $nsca_port" >&5 $as_echo " NSCA port: $nsca_port" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: NSCA user: $nsca_user" >&5 $as_echo " NSCA user: $nsca_user" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: NSCA group: $nsca_grp" >&5 $as_echo " NSCA group: $nsca_grp" >&6; } echo "" echo "" echo "Review the options above for accuracy. If they look okay," echo "type 'make all' to compile the NSCA daemon and client." echo "" nsca-2.9.2/configure.ac000066400000000000000000000214361302203100700147300ustar00rootroot00000000000000dnl Process this -*-m4-*- file with autoconf to produce a configure script. dnl Disable caching define([AC_CACHE_LOAD],) define([AC_CACHE_SAVE],) AC_INIT([nsca],[2.9.2],[nagios-users@lists.sourceforge.net],[nsca],[http://www.nagios.org]) AC_CONFIG_SRCDIR([src/nsca.c]) AC_CONFIG_HEADER(include/config.h) AC_CONFIG_FILES([Makefile subst src/Makefile package/solaris/Makefile init-script sample-config/nsca.cfg sample-config/send_nsca.cfg sample-config/nsca.xinetd]) AC_PREFIX_DEFAULT(/usr/local/nagios) PKG_NAME=nsca PKG_VERSION="2.9.2" PKG_HOME_URL="http://www.nagios.org/" PKG_REL_DATE="12-07-2016" AC_SUBST(PKG_NAME) AC_SUBST(PKG_VERSION) AC_SUBST(PKG_HOME_URL) AC_SUBST(PKG_REL_DATE) dnl Figure out how to invoke "install" and what install options to use. AC_PROG_INSTALL AC_SUBST(INSTALL) dnl What OS are we running? AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET dnl Checks for header files. AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(db.h ctype.h errno.h fcntl.h grp.h inttypes.h netdb.h pwd.h regex.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h sys/config.h sys/int_types.h sys/poll.h sys/types.h sys/time.h sys/resource.h sys/socket.h sys/stat.h sys/wait.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_VOLATILE AC_STRUCT_TM AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_TYPE_GETGROUPS dnl Check lengths for later tests of u_int32_t and int32_t AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(long) dnl Define u_int32_t if we don't have it already (Solaris, etc.) AC_CHECK_TYPE(uint32_t,unsigned int) AC_CHECK_TYPE(u_int32_t,unsigned int) if test "$ac_cv_type_u_int32_t" = no ; then if test "$ac_cv_type_u_int32_t" = yes ; then AC_DEFINE(U_INT32_T_IS_UINT32_T,[1],[u_int32_t is uint32_t]) else if test "$ac_cv_sizeof_int" = 4 ; then AC_DEFINE(U_INT32_T_IS_UINT,[1],[u_int32_t is uint]) else if test "$ac_cv_sizeof_long" = 4 ; then AC_DEFINE(U_INT32_T_IS_ULONG,[1],[u_int32_t is ulong]) else if test "$ac_cv_sizeof_short" = 4 ; then AC_DEFINE(U_INT32_T_IS_USHORT,[1],[u_int32_t is ushort]) fi fi fi fi fi dnl Define int32_t if we don't have it already AC_CHECK_TYPE(int32_t,int) if test "$ac_cv_type_int32_t" = no ; then if test "$ac_cv_sizeof_int" = 4 ; then AC_DEFINE(INT32_T_IS_UINT,[1],[int32_t is uint]) else if test "$ac_cv_sizeof_long" = 4 ; then AC_DEFINE(INT32_T_IS_ULONG,[1],[int32_t is ulong]) else if test "$ac_cv_sizeof_short" = 4 ; then AC_DEFINE(INT32_T_IS_USHORT,[1],[int32_t is ushort]) fi fi fi fi dnl Checks for library functions. AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket") AC_SUBST(SOCKETLIBS) AC_CHECK_LIB(wrap,main,[ LIBWRAPLIBS="$LIBWRAPLIBS -lwrap" AC_DEFINE(HAVE_LIBWRAP,[1],[Have the TCP wrappers library]) ]) AC_SUBST(LIBWRAPLIBS) AC_CHECK_FUNCS(strdup strstr strtoul sigaction) dnl Define sig_atomic_t to int if it's not available. AC_CHECK_TYPE([sig_atomic_t],[],[ AC_DEFINE([sig_atomic_t],[int], [Define to 'int' if does not define.]) ],[ #if HAVE_SIGNAL_H #include #endif ]) dnl socklen_t check - from curl AC_CHECK_TYPE([socklen_t], ,[ AC_MSG_CHECKING([for socklen_t equivalent]) AC_CACHE_VAL([curl_cv_socklen_t_equiv], [ # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername curl_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do AC_TRY_COMPILE([ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int getpeername (int, $arg2 *, $t *); ],[ $t len; getpeername(0,0,&len); ],[ curl_cv_socklen_t_equiv="$t" break ]) done done if test "x$curl_cv_socklen_t_equiv" = x; then AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) fi ]) AC_MSG_RESULT($curl_cv_socklen_t_equiv) AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, [type to use in place of socklen_t if not defined])], [#include #include ]) AC_MSG_CHECKING(for type of socket size) AC_TRY_COMPILE([#include #include #include ], [int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);], [AC_DEFINE(SOCKET_SIZE_TYPE, size_t, [Socket Size Type]) AC_MSG_RESULT(size_t)], [AC_DEFINE(SOCKET_SIZE_TYPE, int, [Socket Size Type]) AC_MSG_RESULT(int)]) dnl Optional mcrypt library and include paths AC_ARG_WITH(mcrypt-lib,--with-mcrypt-lib=DIR sets location of the mcrypt client library,[ LDFLAGS="${LDFLAGS} -L${withval}" LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" ]) AC_ARG_WITH(mcrypt-inc,--with-mcrypt-inc=DIR sets location of the mcrypt client include files,[ CFLAGS="${CFLAGS} -I${withval}" ]) dnl Old checks for libmcrypt, no longer needed - 01/17/02 EG dnl AC_CHECK_LIB(ltdl,main) dnl AC_CHECK_LIB(mcrypt,mcrypt,MCRYPTLIBFOUND=yep) dnl Check for mcrypt library MCRYPTLIBFOUND=yep AM_PATH_LIBMCRYPT(2.4.11,,MCRYPTLIBFOUND=nope) dnl added for automatic use of mcrypt stark@suse.de if test $MCRYPTLIBFOUND = yep; then CFLAGS="${CFLAGS} -DHAVE_LIBMCRYPT ${LIBMCRYPT_CFLAGS}" LDFLAGS="${LDFLAGS} ${LIBMCRYPT_LIBS}" fi dnl Did we find the mcrypt library? if test x$MCRYPTLIBFOUND = xnope; then echo "" echo "" echo "**************************************************************" echo "MCRYPT LIBRARY (libmcrypt) COULD NOT BE LOCATED..." echo "" echo "The mcrypt library could not be located on your system. This" echo "means that you will NOT be able to use any crypto algorithms" echo "in the NSCA client or daemon." echo "" echo "Read the SECURITY text file for more information on why" echo "encryption is important to ensuring that the NSCA daemon is" echo "not abused by malicious users." echo "" echo "You can download libmcrypt from:" echo "" echo " http://mcrypt.sourceforge.net/" echo "" echo "" echo "NOTE: After you install the MCRYPT library on your system:" echo "" echo " 1. Make sure /etc/ld.so.conf has an entry for the" echo " directory in which the MCRYPT library is installed." echo " 2. Run 'ldconfig' to update the run-time linker options." echo " 3. Run 'make devclean' in the NSCA distribution to clean" echo " out any old references to your previous compile." echo " 4. Rerun the configure script." echo "" echo "**************************************************************" echo "" fi AC_ARG_WITH(log_facility,--with-log-facility= sets NSCA syslog facility,log_facility=$withval,log_facility=daemon) AC_SUBST(log_facility) AC_DEFINE_UNQUOTED(NSCA_LOG_FACILITY,["$log_facility"],[NSCA syslog facility]) AC_ARG_WITH(nsca_user,--with-nsca-user= sets user name to run NSCA,nsca_user=$withval,nsca_user=nagios) AC_ARG_WITH(nsca_grp,--with-nsca-grp= sets group name to run NSCA,nsca_grp=$withval,nsca_grp=nagios) AC_ARG_WITH(nsca_port,--with-nsca-port= sets port number for NSCA to listen on,nsca_port=$withval,nsca_port=5667) AC_SUBST(nsca_user) AC_SUBST(nsca_grp) AC_SUBST(nsca_port) AC_DEFINE_UNQUOTED(DEFAULT_SERVER_PORT,$nsca_port,[Default port for NSCA daemon]) # Determine target OS, version and architecture for package build macros if test "x$target_ver" = "x" ; then TARGET_VER=`uname -r` else TARGET_VER=$target_ver fi AC_SUBST(TARGET_VER) if test "x$target_os" = "x" ; then TARGET_OS=`uname -s` else TARGET_OS=$target_os fi AC_SUBST(TARGET_OS) if test "x$target_cpu" = "x" ; then TARGET_ARCH=`uname -p` else TARGET_ARCH=$target_cpu fi AC_SUBST(TARGET_ARCH) TARGET_PLATFORM="" if test "x$TARGET_OS" = "xSunOS" ; then if test "x$TARGET_VER" = "x5.10" ; then TARGET_PLATFORM="sol10" fi fi AC_SUBST(TARGET_PLATFORM) AC_PATH_PROG(PERL,perl) AC_OUTPUT() perl subst init-script perl subst sample-config/nsca.xinetd perl subst sample-config/nsca.cfg perl subst sample-config/send_nsca.cfg dnl Review options echo "" echo "" AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:]) echo "" echo " General Options:" echo " -------------------------" AC_MSG_RESULT([ NSCA port: $nsca_port]) AC_MSG_RESULT([ NSCA user: $nsca_user]) AC_MSG_RESULT([ NSCA group: $nsca_grp]) echo "" echo "" echo "Review the options above for accuracy. If they look okay," echo "type 'make all' to compile the NSCA daemon and client." echo "" nsca-2.9.2/include/000077500000000000000000000000001302203100700140575ustar00rootroot00000000000000nsca-2.9.2/include/common.h000066400000000000000000000121321302203100700155170ustar00rootroot00000000000000/************************************************************************ * * COMMON.H - NSCA Common Include File * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org) * Last Modified: 12-07-2016 * * License: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #include "config.h" #define PROGRAM_VERSION "2.9.2" #define MODIFICATION_DATE "12-07-2016" #define OK 0 #define ERROR -1 #define TRUE 1 #define FALSE 0 #define STATE_UNKNOWN 3 /* service state return codes */ #define STATE_CRITICAL 2 #define STATE_WARNING 1 #define STATE_OK 0 #define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */ #define MAX_INPUT_BUFFER 5120 /* max size of most buffers we use */ #define MAX_HOST_ADDRESS_LENGTH 256 /* max size of a host address */ /**************************************************************************************/ /* WARNING! */ /* */ /* Changing the lengths below may cause packet failures between clients and servers */ /* of different versions. */ /**************************************************************************************/ #define MAX_HOSTNAME_LENGTH 64 #define MAX_DESCRIPTION_LENGTH 128 #define MAX_PLUGINOUTPUT_LENGTH 4096 #define OLD_PLUGINOUTPUT_LENGTH 512 #define OLD_PACKET_LENGTH (( sizeof( data_packet) - ( MAX_PLUGINOUTPUT_LENGTH - OLD_PLUGINOUTPUT_LENGTH))) #define MAX_PASSWORD_LENGTH 512 #define BLOCK_DELIMITER "\x17" /********************* ENCRYPTION TYPES ****************/ #define ENCRYPT_NONE 0 /* no encryption */ #define ENCRYPT_XOR 1 /* not really encrypted, just obfuscated */ #ifdef HAVE_LIBMCRYPT #define ENCRYPT_DES 2 /* DES */ #define ENCRYPT_3DES 3 /* 3DES or Triple DES */ #define ENCRYPT_CAST128 4 /* CAST-128 */ #define ENCRYPT_CAST256 5 /* CAST-256 */ #define ENCRYPT_XTEA 6 /* xTEA */ #define ENCRYPT_3WAY 7 /* 3-WAY */ #define ENCRYPT_BLOWFISH 8 /* SKIPJACK */ #define ENCRYPT_TWOFISH 9 /* TWOFISH */ #define ENCRYPT_LOKI97 10 /* LOKI97 */ #define ENCRYPT_RC2 11 /* RC2 */ #define ENCRYPT_ARCFOUR 12 /* RC4 */ #define ENCRYPT_RC6 13 /* RC6 */ /* UNUSED */ #define ENCRYPT_RIJNDAEL128 14 /* RIJNDAEL-128 */ #define ENCRYPT_RIJNDAEL192 15 /* RIJNDAEL-192 */ #define ENCRYPT_RIJNDAEL256 16 /* RIJNDAEL-256 */ #define ENCRYPT_MARS 17 /* MARS */ /* UNUSED */ #define ENCRYPT_PANAMA 18 /* PANAMA */ /* UNUSED */ #define ENCRYPT_WAKE 19 /* WAKE */ #define ENCRYPT_SERPENT 20 /* SERPENT */ #define ENCRYPT_IDEA 21 /* IDEA */ /* UNUSED */ #define ENCRYPT_ENIGMA 22 /* ENIGMA (Unix crypt) */ #define ENCRYPT_GOST 23 /* GOST */ #define ENCRYPT_SAFER64 24 /* SAFER-sk64 */ #define ENCRYPT_SAFER128 25 /* SAFER-sk128 */ #define ENCRYPT_SAFERPLUS 26 /* SAFER+ */ #endif /******************** MISC DEFINITIONS *****************/ #define TRANSMITTED_IV_SIZE 128 /* size of IV to transmit - must be as big as largest IV needed for any crypto algorithm */ /*************** PACKET STRUCTURE DEFINITIONS **********/ #define NSCA_PACKET_VERSION_3 3 /* packet version identifier */ #define NSCA_PACKET_VERSION_2 2 /* older packet version identifiers */ #define NSCA_PACKET_VERSION_1 1 /* data packet containing service check results */ typedef struct data_packet_struct{ int16_t packet_version; u_int32_t crc32_value; u_int32_t timestamp; int16_t return_code; char host_name[MAX_HOSTNAME_LENGTH]; char svc_description[MAX_DESCRIPTION_LENGTH]; char plugin_output[MAX_PLUGINOUTPUT_LENGTH]; }data_packet; /* initialization packet containing IV and timestamp */ typedef struct init_packet_struct{ char iv[TRANSMITTED_IV_SIZE]; u_int32_t timestamp; }init_packet; /**************** OPERATING SYSTEM SPECIFIC DEFINITIONS **********/ #ifdef __sun # ifndef LOG_AUTHPRIV # define LOG_AUTHPRIV LOG_AUTH # endif # ifndef LOG_FTP # define LOG_FTP LOG_DAEMON # endif #endif nsca-2.9.2/include/config.h.in000066400000000000000000000112251302203100700161030ustar00rootroot00000000000000/************************************************************************ * * NSCA Common Config Header File * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org) * Last Modified: 11-23-2007 * * License: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. ************************************************************************/ #ifndef _CONFIG_H #define _CONFIG_H #include #include #define DEFAULT_SERVER_PORT @nsca_port@ /* default port to use */ #define NSCA_LOG_FACILITY @log_facility@ #undef socklen_t #undef STDC_HEADERS #undef HAVE_SYSLOG_H #undef HAVE_STRDUP #undef HAVE_STRSTR #undef HAVE_STRTOUL #undef HAVE_INITGROUPS #undef HAVE_LIMITS_H #undef HAVE_SYS_RESOURCE_H #undef HAVE_SIGACTION #undef HAVE_LIBWRAP #define SOCKET_SIZE_TYPE "" #define GETGROUPS_T "" #define RETSIGTYPE "" #undef SIZEOF_INT #undef SIZEOF_SHORT #undef SIZEOF_LONG /* stupid stuff for u_int32_t */ #undef U_INT32_T_IS_USHORT #undef U_INT32_T_IS_UINT #undef U_INT32_T_IS_ULONG #undef U_INT32_T_IS_UINT32_T #ifdef U_INT32_T_IS_USHORT typedef unsigned short u_int32_t; #endif #ifdef U_INT32_T_IS_ULONG typedef unsigned long u_int32_t; #endif #ifdef U_INT32_T_IS_UINT typedef unsigned int u_int32_t; #endif #ifdef U_INT32_T_IS_UINT32_t typedef uint32_t u_int32_t; #endif /* stupid stuff for int32_t */ #undef INT32_T_IS_SHORT #undef INT32_T_IS_INT #undef INT32_T_IS_LONG #ifdef INT32_T_IS_USHORT typedef short int32_t; #endif #ifdef INT32_T_IS_ULONG typedef long int32_t; #endif #ifdef INT32_T_IS_UINT typedef int int32_t; #endif #undef HAVE_REGEX_H #ifdef HAVE_REGEX_H #include #endif #undef HAVE_STRINGS_H #undef HAVE_STRING_H #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #undef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H #include #endif #undef HAVE_SIGNAL_H #ifdef HAVE_SIGNAL_H #include #endif #undef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H #include #endif #undef HAVE_SYS_INT_TYPES_H #ifdef HAVE_SYS_INT_TYPES_H #include #endif #undef HAVE_SYS_STAT_H #ifdef HAVE_SYS_STAT_H #include #endif #undef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H #include #endif #undef HAVE_STDINT_H #ifdef HAVE_STDINT_H #include #endif #undef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H #include #endif #undef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H #include #endif #undef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H #include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #undef HAVE_ERRNO_H #ifdef HAVE_ERRNO_H #include #endif /* needed for the time_t structures we use later... */ #undef TIME_WITH_SYS_TIME #undef HAVE_SYS_TIME_H #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #undef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H #include #endif #undef HAVE_SOCKET #ifdef HAVE_SOCKET_H #include #endif #undef HAVE_TCPD_H #ifdef HAVE_TCPD_H #include #endif #undef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H #include #endif #undef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H #include #endif #undef HAVE_NETDB_H #ifdef HAVE_NETDB_H #include #endif #undef HAVE_CTYPE_H #ifdef HAVE_CTYPE_H #include #endif #undef HAVE_LIBMCRYPT #ifdef HAVE_LIBMCRYPT #include #endif #undef HAVE_DB_H #ifdef HAVE_DB_H #include #endif #undef HAVE_PWD_H #ifdef HAVE_PWD_H #include #endif #undef HAVE_GRP_H #ifdef HAVE_GRP_H #include #endif #undef HAVE_INTTYPES_H #ifdef HAVE_INTTYPES_H #include #endif #undef HAVE_SYS_CONFIG_H #ifdef HAVE_SYS_CONFIG_H #include #endif #undef HAVE_INTTYPES_H #undef HAVE_STDINT_H #ifdef HAVE_INTTYPES_H #include #else #ifdef HAVE_STDINT_H #include #endif #endif #endif nsca-2.9.2/include/netutils.h000066400000000000000000000026601302203100700161030ustar00rootroot00000000000000/************************************************************************************************ * * NETUTILS.H - NSCA Network Utilities Include File * * License: GPL * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org) * * Last Modified: 10-15-2003 * * Description: * * This file contains common include files and function definitions used in many of the plugins. * * License Information: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * ************************************************************************************************/ #include "../include/config.h" int my_tcp_connect(char *,int,int *); int my_connect(char *,int,int *,char *); int my_inet_aton(register const char *,struct in_addr *); int sendall(int,char *,int *); int recvall(int,char *,int *,int); nsca-2.9.2/include/nsca.h000066400000000000000000000036771302203100700151710ustar00rootroot00000000000000/************************************************************************ * * NSCA.H - NSCA Include File * Copyright (c) 1999-2009 Ethan Galstad (nagios@nagios.org) * Last Modified: 07-07-2009 * * License: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * ************************************************************************/ struct handler_entry{ void (*handler)(int, void *); void *data; int fd; }; static void handle_events(void); static void wait_for_connections(void); static void handle_connection(int,void *); static void accept_connection(int,void *); static void handle_connection_read(int,void *); static void install_child_handler(void); static int process_arguments(int,char **); static int read_config_file(char *); int get_log_facility(char *); static int open_command_file(void); static void close_command_file(void); static int write_checkresult_file(char *,char *,int,char *,time_t); static int write_check_result(char *,char *,int,char *,time_t); static int get_user_info(const char *,uid_t *); static int get_group_info(const char *,gid_t *); static int drop_privileges(const char *,uid_t,gid_t); static void do_chroot(void); static void do_exit(int); static void free_memory(void); static int write_pid_file(uid_t,gid_t); static int remove_pid_file(void); void sighandler(int); nsca-2.9.2/include/utils.h000066400000000000000000000036421302203100700153750ustar00rootroot00000000000000/********************************************************************************* * * UTILS.H - Header file for NSCA utility functions * * License: GPL * Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org) * * Last Modified: 10-15-2003 * * Description: * * * License Information: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * ********************************************************************************/ #ifndef NSCA_UTILS_H_INCLUDED #define NSCA_UTILS_H_INCLUDED #include "config.h" struct crypt_instance { char transmitted_iv[TRANSMITTED_IV_SIZE]; #ifdef HAVE_LIBMCRYPT MCRYPT td; char *key; char *IV; char block_buffer; int blocksize; int keysize; char *mcrypt_algorithm; char *mcrypt_mode; #endif }; char *escape_newlines(char *); void generate_crc32_table(void); unsigned long calculate_crc32(char *, int); int encrypt_init(char *,int,char *,struct crypt_instance **); void encrypt_cleanup(int,struct crypt_instance *); static void generate_transmitted_iv(char *transmitted_iv); void encrypt_buffer(char *,int,char *,int,struct crypt_instance *); void decrypt_buffer(char *,int,char *,int,struct crypt_instance *); void randomize_buffer(char *,int); void strip(char *); void clear_buffer(char *,int); void display_license(void); #endif nsca-2.9.2/init-script.in000066400000000000000000000023611302203100700152330ustar00rootroot00000000000000#!/bin/sh # # Last Modified 01-07-2003 Ethan Galstad (nagios@nagios.org) # Notes # This script takes care of starting and stopping the NSCA daemon. # Modeled after init script for NRPE written by jaclu@grm.se # # chkconfig: 2345 80 30 # description: nsca is a daemon for accepting service check results \ # from applications running on other hosts. # processname: nsca # config: /usr/local/nagios/etc/nsca.cfg # Source function library if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions elif [ -f /etc/init.d/functions ]; then . /etc/init.d/functions elif [ -f /etc/rc.d/functions ]; then . /etc/rc.d/functions fi # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 NscaBin=@bindir@/nsca NscaCfg=@sysconfdir@/nsca.cfg LockFile=/var/lock/subsys/nsca # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting nsca: " daemon $NscaBin -s -c $NscaCfg RETVAL=$? echo touch $LockFile ;; stop) # Stop daemons. echo -n "Shutting down nsca: " killproc nsca echo rm -f $LockFile ;; restart) $0 stop $0 start ;; status) status nsca ;; *) echo "Usage: nsca {start|stop|restart|status}" exit 1 esac exit 0 nsca-2.9.2/install-sh000077500000000000000000000127211302203100700144430ustar00rootroot00000000000000#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # 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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 nsca-2.9.2/nsca.spec000066400000000000000000000112721302203100700142370ustar00rootroot00000000000000%define name nsca %define version 2.9.2 %define release 1 %define nsusr nagios %define nsgrp nagios %define nsport 5667 # %define nsport 8086 # Reserve option to override port setting with: # rpm -ba|--rebuild --define 'nsport 5666' %{?port:%define nsport %{port}} # Macro that print mesages to syslog at package (un)install time %define nnmmsg logger -t %{name}/rpm Summary: Host/service/network monitoring agent for Nagios URL: http://www.nagios.org Name: %{name} Version: %{version} Release: %{release} License: GPL Group: Application/System Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-buildroot Requires: bash, nagios, libmcrypt, xinetd # uncomment this for RedHat Enterprise Linux 3: #PreReq: util-linux, sh-utils, shadow-utils, sed, fileutils, mktemp # SuSE Linux Enterprise Server 8: PreReq: util-linux, sh-utils, shadow, sed, fileutils, mktemp %description This program is designed to accept passive service check results from clients that use the send_nsca utility and pass them along to the Nagios process by using the external command interface. The program can either be run as a standalone daemon or as a service under inetd. If you have libmcrypt installed on your systems, you can choose from multiple crypto algorithms (DES, 3DES, CAST, xTEA, Twofish, LOKI97, RJINDAEL, SERPENT, GOST, SAFER/SAFER+, etc.) for encrypting the traffic between the client and the server. Encryption is important in this addon, as it prevents unauthorized users from sending bogus check results to Nagios. Read the included SECURITY document for more information. This package provides the core agent running on the Nagios server %package send Requires: libmcrypt Group: Application/System Summary: Provides the send_nsca utility running on the Nagios-Client. %description send This program is designed to accept passive service check results from clients that use the send_nsca utility (which is included in this package) and pass them along to the Nagios process by using the external command interface. The program can either be run as a standalone daemon or as a service under inetd. If you have libmcrypt installed on your systems, you can choose from multiple crypto algorithms (DES, 3DES, CAST, xTEA, Twofish, LOKI97, RJINDAEL, SERPENT, GOST, SAFER/SAFER+, etc.) for encrypting the traffic between the client and the server. Encryption is important in this addon, as it prevents unauthorized users from sending bogus check results to Nagios. Read the included SECURITY document for more information. This package provides the send_nsca utility running on the client. %prep %setup -q %pre # Create `nagios' user on the system if necessary if id %{nsusr} then : # user already exists else grep nagios /etc/group &>/dev/null || /usr/sbin/groupadd -r nagios /usr/sbin/useradd -r -d /var/log/nagios -s /bin/sh -c "%{nsusr}" -g %{nsgrp} %{nsusr} || \ %nnmmsg Unexpected error adding user "%{nsusr}". Aborting install process. fi # if LSB standard /etc/init.d does not exist, # create it as a symlink to the first match we find if [ -d /etc/init.d -o -L /etc/init.d ]; then : # we're done elif [ -d /etc/rc.d/init.d ]; then ln -s /etc/rc.d/init.d /etc/init.d elif [ -d /usr/local/etc/rc.d ]; then ln -s /usr/local/etc/rc.d /etc/init.d elif [ -d /sbin/init.d ]; then ln -s /sbin/init.d /etc/init.d fi %postun /etc/init.d/xinetd restart %post /etc/init.d/xinetd restart %build export PATH=$PATH:/usr/sbin CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \ ./configure \ --with-nsca-port=%{nsport} \ --with-nsca-user=%{nsusr} \ --with-nsca-grp=%{nsgrp} \ --prefix="" \ --bindir=%{_prefix}/bin \ --sysconfdir=/etc/nagios \ --localstatedir=/var/spool/nagios \ make all %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT install -b -D -m 0644 sample-config/nsca.cfg ${RPM_BUILD_ROOT}/etc/nagios/nsca.cfg install -b -D -m 0644 sample-config/send_nsca.cfg ${RPM_BUILD_ROOT}/etc/nagios/send_nsca.cfg install -b -D -m 0644 sample-config/nsca.xinetd ${RPM_BUILD_ROOT}/etc/xined.d/nsca install -b -D -m 0755 src/nsca ${RPM_BUILD_ROOT}/usr/sbin/nsca install -b -D -m 0755 src/send_nsca ${RPM_BUILD_ROOT}/usr/bin/send_nsca %clean rm -rf $RPM_BUILD_ROOT %files %defattr(755,root,root) /etc/xined.d/nsca /usr/sbin/nsca %dir /etc/nagios %defattr(644,root,root) %config(noreplace) /etc/nagios/*.cfg %defattr(755,%{nsusr},%{nsgrp}) %doc Changelog LEGAL README SECURITY %files send %defattr(755,root,root) /usr/bin/send_nsca %defattr(644,root,root) %config(noreplace) /etc/nagios/send_nsca.cfg %defattr(755,%{nsusr},%{nsgrp}) %doc Changelog LEGAL README SECURITY %changelog * Wed Jan 28 2004 Falk Höppner - Create SPEC from nrpe.spec - Tested on ia32/ia64 with SLES8/RHEL3 nsca-2.9.2/nsca_tests/000077500000000000000000000000001302203100700146025ustar00rootroot00000000000000nsca-2.9.2/nsca_tests/NSCATest.pm000066400000000000000000000035061302203100700165300ustar00rootroot00000000000000# # DESCRIPTION: # Helper object class for NSCA testing # # COPYRIGHT: # Copyright (C) 2007 Altinity Limited # Copyright is freely given to Ethan Galstad if included in the NSCA distribution # # LICENCE: # GNU GPLv2 package NSCATest; use strict; use Class::Struct; use IO::File; struct NSCATest => { config => '$', pid => '$', timeout => '$', }; $| = 1; # Autoflush on sub start { my ($self, $mode) = @_; $mode ||= "--single"; printf "Starting nsca with $mode\n"; system("../src/nsca -c nsca_".$self->config.".cfg $mode"); sleep 1; # Let daemon start open F, "var/nsca.pid" or die "No pid file found"; chop(my $pid = ); close F; $self->pid($pid); open(F, "> var/nagios.cmd") or die "Cannot create var/nagios.cmd"; close F; return $pid; } sub stop { my $self = shift; print "Stopping nsca: ".$self->pid.$/; kill "TERM", $self->pid; $self->pid(undef); unlink "var/nagios.cmd", "var/nsca.dump"; sleep 1; # Let daemon die } sub send { my ($self, $data) = @_; my @output = map { join("\t", @$_)."\n" } @$data; open SEND, "| ".$self->send_cmd; print SEND @output; close SEND; } sub send_cmd { my ($self) = @_; my $timeout = $self->timeout || 2; return "../src/send_nsca -to $timeout -p 56677 -H localhost -c send_".$self->config.".cfg"; } sub read_cmd { my ($self, $file) = @_; $file ||= "var/nagios.cmd"; my $fh = IO::File->new($file) or die "Can't open $file"; $self->process_data($fh); } sub process_data { my ($self, $fh) = @_; my $data = []; while(<$fh>) { chop; my @bits = /\[\d+\] PROCESS_(?:HOST|SERVICE)_CHECK_RESULT;([^;]+);(?:([^;]+);)?([0123]);(.*)$/o; # Remove the service name if doesn't exist splice @bits, 1, 1 unless defined $bits[1]; push @$data, [ @bits ]; } return $data; } # Was thinking of calling $self->stop in DESTROY, but with the forking # going on, this wouldn't work 1; nsca-2.9.2/nsca_tests/README000066400000000000000000000020031302203100700154550ustar00rootroot00000000000000NSCA Tests ========== Originally contributed by Ton Voon/Altinity 01/26/2007. These tests are designed to make sure that the Nagios daemon can start up and accept messages by comparing the output in the dummy nagios.cmd file with the sent data. There are 3 tests at the moment: * basic - just sends a few passive checks and makes sure that the nagios.cmd file receives them * multiple - runs the same as basic, but several times to check the daemon can handle multiple requests * simultaneous - runs lots of send_nscas at the same time (well, nearly). Uses Parallel::Forker to setup all the sends then executes them all at once. Expect about 200 extra processes to hit your server! Requirements ------------ You will need to have the following CPAN modules installed: Test::More Class::Struct Clone Parallel::Forker Running the Tests ----------------- 1. Run the NSCA configure script and compile the NSCA binaries 2. Run the tests from this directory by running the following command: ./runtests nsca-2.9.2/nsca_tests/basic.t000077500000000000000000000020161302203100700160520ustar00rootroot00000000000000#!/usr/bin/perl # # DESCRIPTION: # Test sending basic passive results to nsca # # COPYRIGHT: # Copyright (C) 2007 Altinity Limited # Copyright is freely given to Ethan Galstad if included in the NSCA distribution # # LICENCE: # GNU GPLv2 use strict; use NSCATest; use Test::More; plan tests => 2; my $data = [ ["hostname", "0", "Plugin output"], ["hostname-with-other-bits", "1", "More data to be read"], ["hostname.here", "2", "Check that ; are okay to receive"], ["host", "service", 0, "A good result here"], ["host54", "service with spaces", 1, "Warning! My flies are undone!"], ["host-robin", "service with a :)", 2, "Critical? Alert! Alert!"], ["host-batman", "another service", 3, "Unknown - the only way to travel"], ]; foreach my $type qw(--single --daemon) { my $nsca = NSCATest->new( config => "basic" ); $nsca->start($type); $nsca->send($data); sleep 1; # Need to wait for --daemon to finish processing my $output = $nsca->read_cmd; is_deeply($data, $output, "Got all data as expected"); $nsca->stop; } nsca-2.9.2/nsca_tests/multiple.t000077500000000000000000000015751302203100700166350ustar00rootroot00000000000000#!/usr/bin/perl # # DESCRIPTION: # Test sending more than one passive result to nsca # # COPYRIGHT: # Copyright (C) 2007 Altinity Limited # Copyright is freely given to Ethan Galstad if included in the NSCA distribution # # LICENCE: # GNU GPLv2 use strict; use NSCATest; use Test::More; use Clone qw(clone); my $iterations = 10; plan tests => 2; my $data = [ ["hostname", "0", "Plugin output"], ["host", "service", 0, "A good result here"], ]; my $copies = []; for (1 .. $iterations) { my $c = clone($data); push @$copies, @$c; } foreach my $type qw(--single --daemon) { my $nsca = NSCATest->new( config => "basic" ); $nsca->start($type); my $i = 0; for($i; $i < $iterations; $i++) { $nsca->send($data); } sleep 1; # Need to wait for --daemon to finish processing my $output = $nsca->read_cmd; is_deeply( $output, $copies ); $nsca->stop; } nsca-2.9.2/nsca_tests/nsca_basic.cfg000066400000000000000000000122651302203100700173560ustar00rootroot00000000000000#################################################### # Sample NSCA Daemon Config File # Written by: Ethan Galstad (nagios@nagios.org) # # Last Modified: 04-03-2006 #################################################### # PID FILE # The name of the file in which the NSCA daemon should write it's process ID # number. The file is only written if the NSCA daemon is started by the root # user as a single- or multi-process daemon. pid_file=var/nsca.pid # PORT NUMBER # Port number we should wait for connections on. # This must be a non-priveledged port (i.e. > 1024). server_port=56677 # SERVER ADDRESS # Address that NSCA has to bind to in case there are # more as one interface and we do not want NSCA to bind # (thus listen) on all interfaces. #server_address=192.168.1.1 # NSCA USER # This determines the effective user that the NSCA daemon should run as. # You can either supply a username or a UID. # # NOTE: This option is ignored if NSCA is running under either inetd or xinetd #nsca_user=nagios # NSCA GROUP # This determines the effective group that the NSCA daemon should run as. # You can either supply a group name or a GID. # # NOTE: This option is ignored if NSCA is running under either inetd or xinetd #nsca_group=nagios # NSCA CHROOT # If specified, determines a directory into which the nsca daemon # will perform a chroot(2) operation before dropping its privileges. # for the security conscious this can add a layer of protection in # the event that the nagios daemon is compromised. # # NOTE: if you specify this option, the command file will be opened # relative to this directory. #nsca_chroot=/var/run/nagios/rw # DEBUGGING OPTION # This option determines whether or not debugging # messages are logged to the syslog facility. # Values: 0 = debugging off, 1 = debugging on debug=0 # COMMAND FILE # This is the location of the Nagios command file that the daemon # should write all service check results that it receives. command_file=var/nagios.cmd # ALTERNATE DUMP FILE # This is used to specify an alternate file the daemon should # write service check results to in the event the command file # does not exist. It is important to note that the command file # is implemented as a named pipe and only exists when Nagios is # running. You may want to modify the startup script for Nagios # to dump the contents of this file into the command file after # it starts Nagios. Or you may simply choose to ignore any # check results received while Nagios was not running... alternate_dump_file=var/nsca.dump # AGGREGATED WRITES OPTION # This option determines whether or not the nsca daemon will # aggregate writes to the external command file for client # connections that contain multiple check results. If you # are queueing service check results on remote hosts and # sending them to the nsca daemon in bulk, you will probably # want to enable bulk writes, as this will be a bit more # efficient. # Values: 0 = do not aggregate writes, 1 = aggregate writes aggregate_writes=0 # APPEND TO FILE OPTION # This option determines whether or not the nsca daemon will # will open the external command file for writing or appending. # This option should almost *always* be set to 0! # Values: 0 = open file for writing, 1 = open file for appending append_to_file=1 # MAX PACKET AGE OPTION # This option is used by the nsca daemon to determine when client # data is too old to be valid. Keeping this value as small as # possible is recommended, as it helps prevent the possibility of # "replay" attacks. This value needs to be at least as long as # the time it takes your clients to send their data to the server. # Values are in seconds. The max packet age cannot exceed 15 # minutes (900 seconds). If this variable is set to zero (0), no # packets will be rejected based on their age. max_packet_age=30 # DECRYPTION PASSWORD # This is the password/passphrase that should be used to descrypt the # incoming packets. Note that all clients must encrypt the packets # they send using the same password! # IMPORTANT: You don't want all the users on this system to be able # to read the password you specify here, so make sure to set # restrictive permissions on this config file! #password= # DECRYPTION METHOD # This option determines the method by which the nsca daemon will # decrypt the packets it receives from the clients. The decryption # method you choose will be a balance between security and performance, # as strong encryption methods consume more processor resources. # You should evaluate your security needs when choosing a decryption # method. # # Note: The decryption method you specify here must match the # encryption method the nsca clients use (as specified in # the send_nsca.cfg file)!! # Values: # # 0 = None (Do NOT use this option) # 1 = Simple XOR (No security, just obfuscation, but very fast) # # 2 = DES # 3 = 3DES (Triple DES) # 4 = CAST-128 # 5 = CAST-256 # 6 = xTEA # 7 = 3WAY # 8 = BLOWFISH # 9 = TWOFISH # 10 = LOKI97 # 11 = RC2 # 12 = ARCFOUR # # 14 = RIJNDAEL-128 # 15 = RIJNDAEL-192 # 16 = RIJNDAEL-256 # # 19 = WAKE # 20 = SERPENT # # 22 = ENIGMA (Unix crypt) # 23 = GOST # 24 = SAFER64 # 25 = SAFER128 # 26 = SAFER+ # decryption_method=2 nsca-2.9.2/nsca_tests/runtests000077500000000000000000000000261302203100700164150ustar00rootroot00000000000000#!/bin/sh prove *.t nsca-2.9.2/nsca_tests/send_basic.cfg000066400000000000000000000031331302203100700173550ustar00rootroot00000000000000#################################################### # Sample NSCA Client Config File # Written by: Ethan Galstad (nagios@nagios.org) # # Last Modified: 02-21-2002 #################################################### # ENCRYPTION PASSWORD # This is the password/passphrase that should be used to encrypt the # outgoing packets. Note that the nsca daemon must use the same # password when decrypting the packet! # IMPORTANT: You don't want all the users on this system to be able # to read the password you specify here, so make sure to set # restrictive permissions on this config file! #password= # ENCRYPTION METHOD # This option determines the method by which the send_nsca client will # encrypt the packets it sends to the nsca daemon. The encryption # method you choose will be a balance between security and performance, # as strong encryption methods consume more processor resources. # You should evaluate your security needs when choosing an encryption # method. # # Note: The encryption method you specify here must match the # decryption method the nsca daemon uses (as specified in # the nsca.cfg file)!! # Values: # 0 = None (Do NOT use this option) # 1 = Simple XOR (No security, just obfuscation, but very fast) # # 2 = DES # 3 = 3DES (Triple DES) # 4 = CAST-128 # 5 = CAST-256 # 6 = xTEA # 7 = 3WAY # 8 = BLOWFISH # 9 = TWOFISH # 10 = LOKI97 # 11 = RC2 # 12 = ARCFOUR # # 14 = RIJNDAEL-128 # 15 = RIJNDAEL-192 # 16 = RIJNDAEL-256 # # 19 = WAKE # 20 = SERPENT # # 22 = ENIGMA (Unix crypt) # 23 = GOST # 24 = SAFER64 # 25 = SAFER128 # 26 = SAFER+ # encryption_method=2 nsca-2.9.2/nsca_tests/simultaneous.t000077500000000000000000000036451302203100700175320ustar00rootroot00000000000000#!/usr/bin/perl # # DESCRIPTION: # Test sending lots of results at the same time # # COPYRIGHT: # Copyright (C) 2007 Altinity Limited # Copyright is freely given to Ethan Galstad if included in the NSCA distribution # # LICENCE: # GNU GPLv2 use strict; use NSCATest; use Test::More; use Clone qw(clone); use Parallel::Forker; my $iterations = 100; my $timeout = 8; plan tests => 4; my $data = [ ["hostname", "0", "Plugin output"], ["hostname-with-other-bits", "1", "More data to be read"], ["hostname.here", "2", "Check that ; are okay to receive"], ["host", "service", 0, "A good result here"], ["host54", "service with spaces", 1, "Warning! My flies are undone!"], ["host-robin", "service with a :)", 2, "Critical? Alert! Alert!"], ["host-batman", "another service", 3, "Unknown - the only way to travel"], ]; my $Fork = Parallel::Forker->new; $SIG{CHLD} = sub { $Fork->sig_child; }; $SIG{TERM} = sub { $Fork->kill_tree_all('TERM') if $Fork; die "Quitting..."; }; foreach my $type qw(--single --daemon) { my $expected = []; my $nsca = NSCATest->new( config => "basic", timeout => $timeout ); $nsca->start($type); for (my $i = 0; $i < $iterations; $i++) { my $c = clone($data); push @$c, [ "host$i", 2, "Some unique data: ".rand() ]; push @$expected, @$c; $Fork->schedule( run_on_start => sub { $nsca->send($c) }, ); } $Fork->ready_all; $Fork->wait_all; sleep 1; # Need to wait for --daemon to finish processing my $output = $nsca->read_cmd; is( scalar @$output, scalar @$expected, "Got all ".scalar @$expected." packets of data" ); is_deeply_sorted( $output, $expected, "All data as expected" ); $nsca->stop; } sub is_deeply_sorted { my ($expected, $against, $text) = @_; my $e = [ sort map { join(";", map { $_ } @$_) } @$expected ]; my $a = [ sort map { join(";", map { $_ } @$_) } @$against ]; is_deeply($e, $a, $text); } nsca-2.9.2/nsca_tests/var/000077500000000000000000000000001302203100700153725ustar00rootroot00000000000000nsca-2.9.2/nsca_tests/var/README000066400000000000000000000002151302203100700162500ustar00rootroot00000000000000The purpose of this file is simply to keep this otherwise empty directory from getting pruned when I do CVS exports for new NSCA releases... nsca-2.9.2/package/000077500000000000000000000000001302203100700140275ustar00rootroot00000000000000nsca-2.9.2/package/solaris/000077500000000000000000000000001302203100700155035ustar00rootroot00000000000000nsca-2.9.2/package/solaris/Makefile.in000066400000000000000000000044111302203100700175500ustar00rootroot00000000000000################################### # Makefile for NSCA Solaris Package # # Last Modified: 6 Jan 2012 ################################### TARGET_OS=@TARGET_OS@ TARGET_VER=@TARGET_VER@ TARGET_ARCH=@TARGET_ARCH@ TARGET_PLATFORM=@TARGET_PLATFORM@ SOLARIS_CONFIG_OPTS=--prefix=/opt/nagios --sysconfdir=/etc/nagios PKG_NAME=NGOSnsca PKG_VERSION=@PKG_VERSION@ PKG_FILE=@PACKAGE_NAME@-$(PKG_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH)-local TOPDIR=@top_builddir@ PKGDIR=@builddir@/pkg SRCDIR=@builddir@/build/src INSTALLDIR=@builddir@/install ABSINSTALLDIR=@abs_builddir@/install build: if [ ! -d build ] ; then mkdir build ; fi cd build; ../../../configure $(SOLARIS_CONFIG_OPTS); make all prototype: $(PKGDIR) @echo "i pkginfo" > $(PKGDIR)/prototype @echo "i copyright=../$(TOPDIR)/LEGAL" >> $(PKGDIR)/prototype @echo "i preinstall" >> $(PKGDIR)/prototype @echo "i i.config" >> $(PKGDIR)/prototype @echo "i r.config" >> $(PKGDIR)/prototype @echo "d none /etc/nagios 0755 nagios nagios" >> $(PKGDIR)/prototype @echo "f config /etc/nagios/send_nsca.cfg=$(TOPDIR)/sample-config/send_nsca.cfg 0600 nagios nagios" >> $(PKGDIR)/prototype @echo "d none /opt/nagios/bin 0755 nagios bin" >> $(PKGDIR)/prototype @echo "f none /opt/nagios/bin/send_nsca=$(SRCDIR)/send_nsca 0755 nagios bin" >> $(PKGDIR)/prototype pkginfo: $(PKGDIR) @echo PKG="$(PKG_NAME)" > $(PKGDIR)/pkginfo @echo NAME="Nagios Service Check Acceptor $(PKG_VERSION)" >> $(PKGDIR)/pkginfo @echo VERSION="$(PKG_VERSION)" >> $(PKGDIR)/pkginfo @echo ARCH="$(TARGET_ARCH)" >> $(PKGDIR)/pkginfo @echo CATEGORY="utility" >> $(PKGDIR)/pkginfo @echo CLASSES="none config manifest" >> $(PKGDIR)/pkginfo @echo VENDOR="www.nagios.org" >> $(PKGDIR)/pkginfo @echo EMAIL="nagios-users@lists.sourceforge.net" >> $(PKGDIR)/pkginfo @echo ISTATES="S s 1 2 3" >> $(PKGDIR)/pkginfo @echo RSTATES="S s 1 2 3" >> $(PKGDIR)/pkginfo @echo BASEDIR="/" >> $(PKGDIR)/pkginfo $(PKG_FILE): pkginfo prototype pkgmk -o -d $(PKGDIR) -f $(PKGDIR)/prototype -r . pkgtrans ./pkg $(PKG_FILE) $(PKG_NAME) pkg: $(PKG_FILE) all: pkg clean: rm -rf build package rm -rf $(PKGDIR)/$(PKG_NAME) rm -f $(PKGDIR)/prototype $(PKGDIR)/pkginfo rm -f $(PKGDIR)/$(PKG_FILE) rm -f core rm -f *~ */*~ distclean: clean rm -f Makefile rm -f config.log devclean: distclean nsca-2.9.2/package/solaris/pkg/000077500000000000000000000000001302203100700162645ustar00rootroot00000000000000nsca-2.9.2/package/solaris/pkg/i.config000066400000000000000000000031241302203100700177030ustar00rootroot00000000000000#!/usr/bin/sh create_cksum_file() { srcfile=$1 destfile=$2 cksumfile=$3 echo "# DO NOT EDIT OR REMOVE THIS FILE - It is used to determine whether to" > $cksumfile echo "# overwrite $destfile on package update or to remove" >> $cksumfile echo "# it on package deletion." >> $cksumfile /usr/bin/cat $srcfile | /usr/bin/cksum >> $cksumfile /usr/bin/chmod 400 $cksumfile } compare_cksum() { destfile=$1 cksumfile=$2 installed_cksum=`/usr/bin/tail -1 $cksumfile | /usr/bin/awk '{print $1}'` current_cksum=`/usr/bin/cksum $destfile | /usr/bin/awk '{print $1}'` test $installed_cksum = $current_cksum } while read src dest ; do destpath=`echo $dest | /usr/bin/sed -e 's/\/[^/]*$//'` destbase=`/usr/bin/basename $dest` cksumfile="${destpath}/.${destbase}.cksum" if [ -f $dest ] ; then if [ -f $cksumfile ] ; then compare_cksum $dest $cksumfile if [ $? -eq 0 ] ; then /usr/bin/cp $src $dest /usr/bin/chmod 600 $dest /usr/bin/chown nagios:nagios $dest else echo "Existing $dest has been found --" echo " installing $destbase as $dest.pkgnew" /usr/bin/cp $src $dest.pkgnew /usr/bin/chmod 600 $dest.pkgnew /usr/bin/chown nagios:nagios $dest.pkgnew fi else echo "Existing $dest has been found --" echo " installing $destbase as $dest.pkgnew" /usr/bin/cp $src $dest.pkgnew /usr/bin/chmod 600 $dest.pkgnew /usr/bin/chown nagios:nagios $dest.pkgnew fi else create_cksum_file $src $dest $cksumfile /usr/bin/cp $src $dest /usr/bin/chmod 600 $dest /usr/bin/chown nagios:nagios $dest fi done if [ "$1" = "ENDOFCLASS" ] ; then exit 0 fi nsca-2.9.2/package/solaris/pkg/postinstall000066400000000000000000000003401302203100700205600ustar00rootroot00000000000000#!/usr/bin/sh echo "To begin using NRPE, first edit /etc/nagios/nrpe.cfg, update the" echo "allowed_hosts line and any command lines. Then start the nrpe service" echo "by running the command 'svcadm enable nrpe' as root." nsca-2.9.2/package/solaris/pkg/preinstall000066400000000000000000000014551302203100700203710ustar00rootroot00000000000000#!/usr/bin/sh user="nagios" uid=-1 group="nagios" gid=-1 /usr/bin/getent group $group > /dev/null 2> /dev/null result=$? if [ $result -eq 2 ] ; then echo "Group $group does not exist. Creating..." if [ $gid -ne -1 ] ; then /usr/sbin/groupadd -g $gid $group else /usr/sbin/groupadd $group fi elif [ $result -ne 0 ] ; then echo "An error occurred determining the existence of the groug $group. Terminating." exit 1; fi /usr/bin/getent passwd $user > /dev/null 2> /dev/null result=$? if [ $result -eq 2 ] ; then echo "User $user does not exist. Creating..." if [ $uid -ne -1 ] ; then /usr/sbin/useradd -u $uid -g $group $user else /usr/sbin/useradd -g $group $user fi elif [ $result -ne 0 ] ; then echo "An error occurred determining the existence of the user $user. Terminating." exit 1; fi nsca-2.9.2/package/solaris/pkg/r.config000066400000000000000000000015031302203100700177130ustar00rootroot00000000000000#!/usr/bin/sh compare_cksum() { destfile=$1 cksumfile=$2 installed_cksum=`/usr/bin/tail -1 $cksumfile | /usr/bin/awk '{print $1}'` current_cksum=`/usr/bin/cksum $destfile | /usr/bin/awk '{print $1}'` test $installed_cksum = $current_cksum } while read path ; do destpath=`echo $path | /usr/bin/sed -e 's/\/[^/]*$//'` destbase=`/usr/bin/basename $path` cksumfile="${destpath}/.${destbase}.cksum" if [ -f $path ] ; then if [ -f $cksumfile ] ; then compare_cksum $path $cksumfile if [ $? -eq 0 ] ; then /usr/bin/rm -f $path $cksumfile else echo "$path has been modified since it was installed -- " echo " leaving it in place." fi else echo "$path may have been modified since it was installed -- " echo " leaving it in place." fi fi done if [ "$1" = "ENDOFCLASS" ] ; then exit 0 fi nsca-2.9.2/sample-config/000077500000000000000000000000001302203100700151605ustar00rootroot00000000000000nsca-2.9.2/sample-config/nsca.cfg.in000066400000000000000000000130701302203100700171730ustar00rootroot00000000000000#################################################### # Sample NSCA Daemon Config File # Written by: Ethan Galstad (nagios@nagios.org) # # Last Modified: 11-23-2007 #################################################### # LOG FACILITY # The syslog facility that should be used for logging purposes. log_facility=@log_facility@ # Check Result directory. If passed, skip command pipe and submit # directly into the checkresult directory. Requires Nagios 3+ # For best results, mount dir on ramdisk. #check_result_path=/usr/local/nagios/var/checkresults # PID FILE # The name of the file in which the NSCA daemon should write it's process ID # number. The file is only written if the NSCA daemon is started by the root # user as a single- or multi-process daemon. pid_file=/var/run/nsca.pid # PORT NUMBER # Port number we should wait for connections on. # This must be a non-priveledged port (i.e. > 1024). server_port=@nsca_port@ # SERVER ADDRESS # Address that NSCA has to bind to in case there are # more as one interface and we do not want NSCA to bind # (thus listen) on all interfaces. #server_address=192.168.1.1 # NSCA USER # This determines the effective user that the NSCA daemon should run as. # You can either supply a username or a UID. # # NOTE: This option is ignored if NSCA is running under either inetd or xinetd nsca_user=@nsca_user@ # NSCA GROUP # This determines the effective group that the NSCA daemon should run as. # You can either supply a group name or a GID. # # NOTE: This option is ignored if NSCA is running under either inetd or xinetd nsca_group=@nsca_grp@ # NSCA CHROOT # If specified, determines a directory into which the nsca daemon # will perform a chroot(2) operation before dropping its privileges. # for the security conscious this can add a layer of protection in # the event that the nagios daemon is compromised. # # NOTE: if you specify this option, the command file will be opened # relative to this directory. #nsca_chroot=/var/run/nagios/rw # DEBUGGING OPTION # This option determines whether or not debugging # messages are logged to the syslog facility. # Values: 0 = debugging off, 1 = debugging on debug=0 # COMMAND FILE # This is the location of the Nagios command file that the daemon # should write all service check results that it receives. command_file=@localstatedir@/rw/nagios.cmd # ALTERNATE DUMP FILE # This is used to specify an alternate file the daemon should # write service check results to in the event the command file # does not exist. It is important to note that the command file # is implemented as a named pipe and only exists when Nagios is # running. You may want to modify the startup script for Nagios # to dump the contents of this file into the command file after # it starts Nagios. Or you may simply choose to ignore any # check results received while Nagios was not running... alternate_dump_file=@localstatedir@/rw/nsca.dump # AGGREGATED WRITES OPTION # This option determines whether or not the nsca daemon will # aggregate writes to the external command file for client # connections that contain multiple check results. If you # are queueing service check results on remote hosts and # sending them to the nsca daemon in bulk, you will probably # want to enable bulk writes, as this will be a bit more # efficient. # Values: 0 = do not aggregate writes, 1 = aggregate writes aggregate_writes=0 # APPEND TO FILE OPTION # This option determines whether or not the nsca daemon will # will open the external command file for writing or appending. # This option should almost *always* be set to 0! # Values: 0 = open file for writing, 1 = open file for appending append_to_file=0 # MAX PACKET AGE OPTION # This option is used by the nsca daemon to determine when client # data is too old to be valid. Keeping this value as small as # possible is recommended, as it helps prevent the possibility of # "replay" attacks. This value needs to be at least as long as # the time it takes your clients to send their data to the server. # Values are in seconds. The max packet age cannot exceed 15 # minutes (900 seconds). If this variable is set to zero (0), no # packets will be rejected based on their age. max_packet_age=30 # DECRYPTION PASSWORD # This is the password/passphrase that should be used to descrypt the # incoming packets. Note that all clients must encrypt the packets # they send using the same password! # IMPORTANT: You don't want all the users on this system to be able # to read the password you specify here, so make sure to set # restrictive permissions on this config file! #password= # DECRYPTION METHOD # This option determines the method by which the nsca daemon will # decrypt the packets it receives from the clients. The decryption # method you choose will be a balance between security and performance, # as strong encryption methods consume more processor resources. # You should evaluate your security needs when choosing a decryption # method. # # Note: The decryption method you specify here must match the # encryption method the nsca clients use (as specified in # the send_nsca.cfg file)!! # Values: # # 0 = None (Do NOT use this option) # 1 = Simple XOR (No security, just obfuscation, but very fast) # # 2 = DES # 3 = 3DES (Triple DES) # 4 = CAST-128 # 5 = CAST-256 # 6 = xTEA # 7 = 3WAY # 8 = BLOWFISH # 9 = TWOFISH # 10 = LOKI97 # 11 = RC2 # 12 = ARCFOUR # # 14 = RIJNDAEL-128 # 15 = RIJNDAEL-192 # 16 = RIJNDAEL-256 # # 19 = WAKE # 20 = SERPENT # # 22 = ENIGMA (Unix crypt) # 23 = GOST # 24 = SAFER64 # 25 = SAFER128 # 26 = SAFER+ # decryption_method=1 nsca-2.9.2/sample-config/nsca.xinetd.in000066400000000000000000000006631302203100700177330ustar00rootroot00000000000000# default: on # description: NSCA (Nagios Service Check Acceptor) service nsca { flags = REUSE socket_type = stream wait = no user = @nsca_user@ group = @nsca_grp@ server = @bindir@/nsca server_args = -c @sysconfdir@/nsca.cfg --inetd log_on_failure += USERID disable = no only_from = 127.0.0.1 } nsca-2.9.2/sample-config/send_nsca.cfg.in000066400000000000000000000031341302203100700202040ustar00rootroot00000000000000#################################################### # Sample NSCA Client Config File # Written by: Ethan Galstad (nagios@nagios.org) # # Last Modified: 02-21-2002 #################################################### # ENCRYPTION PASSWORD # This is the password/passphrase that should be used to encrypt the # outgoing packets. Note that the nsca daemon must use the same # password when decrypting the packet! # IMPORTANT: You don't want all the users on this system to be able # to read the password you specify here, so make sure to set # restrictive permissions on this config file! #password= # ENCRYPTION METHOD # This option determines the method by which the send_nsca client will # encrypt the packets it sends to the nsca daemon. The encryption # method you choose will be a balance between security and performance, # as strong encryption methods consume more processor resources. # You should evaluate your security needs when choosing an encryption # method. # # Note: The encryption method you specify here must match the # decryption method the nsca daemon uses (as specified in # the nsca.cfg file)!! # Values: # 0 = None (Do NOT use this option) # 1 = Simple XOR (No security, just obfuscation, but very fast) # # 2 = DES # 3 = 3DES (Triple DES) # 4 = CAST-128 # 5 = CAST-256 # 6 = xTEA # 7 = 3WAY # 8 = BLOWFISH # 9 = TWOFISH # 10 = LOKI97 # 11 = RC2 # 12 = ARCFOUR # # 14 = RIJNDAEL-128 # 15 = RIJNDAEL-192 # 16 = RIJNDAEL-256 # # 19 = WAKE # 20 = SERPENT # # 22 = ENIGMA (Unix crypt) # 23 = GOST # 24 = SAFER64 # 25 = SAFER128 # 26 = SAFER+ # encryption_method=1 nsca-2.9.2/src/000077500000000000000000000000001302203100700132235ustar00rootroot00000000000000nsca-2.9.2/src/Makefile.in000066400000000000000000000017371302203100700153000ustar00rootroot00000000000000############################### # Makefile for NSCA # # Last Modified: 10-23-2003 ############################### srcdir=@srcdir@ # Source code directories SRC_INCLUDE=@srcdir@/../include CC=@CC@ CFLAGS=@CFLAGS@ @DEFS@ LDFLAGS=@LDFLAGS@ @LIBS@ SOCKETLIBS=@SOCKETLIBS@ LIBWRAPLIBS=@LIBWRAPLIBS@ CP=@CP@ all: nsca send_nsca nsca: $(srcdir)/nsca.c $(srcdir)/netutils.c $(srcdir)/utils.c $(SRC_INCLUDE)/netutils.h $(SRC_INCLUDE)/utils.h $(SRC_INCLUDE)/common.h $(SRC_INCLUDE)/config.h $(CC) $(CFLAGS) -o $@ $(srcdir)/nsca.c $(srcdir)/netutils.c $(srcdir)/utils.c $(LDFLAGS) $(SOCKETLIBS) $(LIBWRAPLIBS) send_nsca: $(srcdir)/send_nsca.c $(srcdir)/netutils.c $(srcdir)/utils.c $(SRC_INCLUDE)/netutils.h $(SRC_INCLUDE)/utils.h $(SRC_INCLUDE)/common.h $(SRC_INCLUDE)/config.h $(CC) $(CFLAGS) -o $@ $(srcdir)/send_nsca.c $(srcdir)/netutils.c $(srcdir)/utils.c $(LDFLAGS) $(SOCKETLIBS) clean: rm -f core nsca send_nsca rm -f *~ */*~ distclean: clean rm -f Makefile devclean: distclean nsca-2.9.2/src/netutils.c000066400000000000000000000140361302203100700152420ustar00rootroot00000000000000/**************************************************************************** * * NETUTILS.C - NSCA Network Utilities * * License: GPL * Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org) * * Last Modified: 01-21-2006 * * Description: * * This file contains common network functions used in nrpe and check_nrpe. * * License Information: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * ****************************************************************************/ #include "../include/common.h" #include "../include/netutils.h" /* opens a connection to a remote host/tcp port */ int my_tcp_connect(char *host_name,int port,int *sd){ int result; result=my_connect(host_name,port,sd,"tcp"); return result; } /* opens a tcp or udp connection to a remote host */ int my_connect(char *host_name,int port,int *sd,char *proto){ struct sockaddr_in servaddr; struct hostent *hp; struct protoent *ptrp; int result; bzero((char *)&servaddr,sizeof(servaddr)); servaddr.sin_family=AF_INET; servaddr.sin_port=htons(port); /* try to bypass using a DNS lookup if this is just an IP address */ if(!my_inet_aton(host_name,&servaddr.sin_addr)){ /* else do a DNS lookup */ hp=gethostbyname((const char *)host_name); if(hp==NULL){ printf("Invalid host name '%s'\n",host_name); return STATE_UNKNOWN; } memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length); } /* map transport protocol name to protocol number */ if(((ptrp=getprotobyname(proto)))==NULL){ printf("Cannot map \"%s\" to protocol number\n",proto); return STATE_UNKNOWN; } /* create a socket */ *sd=socket(PF_INET,(!strcmp(proto,"udp"))?SOCK_DGRAM:SOCK_STREAM,ptrp->p_proto); if(*sd<0){ printf("Socket creation failed\n"); return STATE_UNKNOWN; } /* open a connection */ result=connect(*sd,(struct sockaddr *)&servaddr,sizeof(servaddr)); if(result<0){ switch(errno){ case ECONNREFUSED: printf("Connection refused by host\n"); break; case ETIMEDOUT: printf("Timeout while attempting connection\n"); break; case ENETUNREACH: printf("Network is unreachable\n"); break; default: printf("Connection refused or timed out\n"); } return STATE_CRITICAL; } return STATE_OK; } /* This code was taken from Fyodor's nmap utility, which was originally taken from the GLIBC 2.0.6 libraries because Solaris doesn't contain the inet_aton() funtion. */ int my_inet_aton(register const char *cp, struct in_addr *addr){ register unsigned int val; /* changed from u_long --david */ register int base, n; register char c; u_int parts[4]; register u_int *pp = parts; c=*cp; for(;;){ /* * Collect number up to ``.''. * Values are specified as for C: * 0x=hex, 0=octal, isdigit=decimal. */ if (!isdigit((int)c)) return (0); val=0; base=10; if(c=='0'){ c=*++cp; if(c=='x'||c=='X') base=16,c=*++cp; else base=8; } for(;;){ if(isascii((int)c) && isdigit((int)c)){ val=(val*base)+(c -'0'); c=*++cp; } else if(base==16 && isascii((int)c) && isxdigit((int)c)){ val=(val<<4) | (c+10-(islower((int)c)?'a':'A')); c = *++cp; } else break; } if(c=='.'){ /* * Internet format: * a.b.c.d * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ if(pp>=parts+3) return (0); *pp++=val; c=*++cp; } else break; } /* Check for trailing characters */ if(c!='\0' && (!isascii((int)c) || !isspace((int)c))) return (0); /* Concoct the address according to the number of parts specified */ n=pp-parts+1; switch(n){ case 0: return (0); /* initial nondigit */ case 1: /* a -- 32 bits */ break; case 2: /* a.b -- 8.24 bits */ if(val>0xffffff) return (0); val|=parts[0]<<24; break; case 3: /* a.b.c -- 8.8.16 bits */ if(val>0xffff) return (0); val|=(parts[0]<< 24) | (parts[1]<<16); break; case 4: /* a.b.c.d -- 8.8.8.8 bits */ if(val>0xff) return (0); val|=(parts[0]<<24) | (parts[1]<<16) | (parts[2]<<8); break; } if(addr) addr->s_addr=htonl(val); return (1); } /* sends all data - thanks to Beej's Guide to Network Programming */ int sendall(int s, char *buf, int *len){ int total=0; int bytesleft=*len; int n=0; while(total<*len){ n=send(s,buf+total,bytesleft,0); if(n==-1) break; total+=n; bytesleft-=n; } /* return number of bytes actually send here */ *len=total; /* return -1 on failure, 0 on success */ return n==-1?-1:0; } /* receives all data - modelled after sendall() */ int recvall(int s, char *buf, int *len, int timeout){ int total=0; int bytesleft=*len; int n=0; time_t start_time; time_t current_time; /* clear the receive buffer */ bzero(buf,*len); time(&start_time); /* receive all data */ while(total<*len){ /* receive some data */ n=recv(s,buf+total,bytesleft,0); /* no data has arrived yet (non-blocking socket) */ if(n==-1 && errno==EAGAIN){ time(¤t_time); if(current_time-start_time>timeout) break; sleep(1); continue; } /* receive error or client disconnect */ else if(n<=0) break; /* apply bytes we received */ total+=n; bytesleft-=n; } /* return number of bytes actually received here */ *len=total; /* return <=0 on failure, bytes received on success */ return (n<=0)?n:total; } nsca-2.9.2/src/nsca.c000066400000000000000000001435251302203100700143250ustar00rootroot00000000000000/******************************************************************************* * * NSCA.C - Nagios Service Check Acceptor * Copyright (c) 2009 Nagios Core Development Team and Community Contributors * Copyright (c) 2000-2009 Ethan Galstad (egalstad@nagios.org) * License: GPL v2 * * Last Modified: 12-07-2016 * * Command line: NSCA -c [mode] * * Description: * * This program is designed to run as a daemon on the main Nagios machine * and accept service check results from remote hosts. * ******************************************************************************/ #include "../include/common.h" #include "../include/config.h" #include "../include/netutils.h" #include "../include/utils.h" #include "../include/nsca.h" static int server_port=DEFAULT_SERVER_PORT; static char server_address[16]="0.0.0.0"; static int socket_timeout=DEFAULT_SOCKET_TIMEOUT; static int log_facility=LOG_DAEMON; static char config_file[MAX_INPUT_BUFFER]="nsca.cfg"; static char alternate_dump_file[MAX_INPUT_BUFFER]="/dev/null"; static char command_file[MAX_INPUT_BUFFER]=""; static char password[MAX_INPUT_BUFFER]=""; static enum { OPTIONS_ERROR, SINGLE_PROCESS_DAEMON, MULTI_PROCESS_DAEMON, INETD } mode=SINGLE_PROCESS_DAEMON; static int debug=FALSE; static int aggregate_writes=FALSE; static int decryption_method=ENCRYPT_XOR; static int append_to_file=FALSE; static unsigned long max_packet_age=30; char *nsca_user=NULL; char *nsca_group=NULL; char *nsca_chroot=NULL; char *check_result_path=NULL; char *pid_file=NULL; int wrote_pid_file=FALSE; int show_help=FALSE; int show_license=FALSE; int show_version=FALSE; int sigrestart=FALSE; int sigshutdown=FALSE; int using_alternate_dump_file=FALSE; static FILE *command_file_fp=NULL; struct handler_entry *rhand=NULL; struct handler_entry *whand=NULL; struct pollfd *pfds=NULL; int maxrhand=0; int maxwhand=0; int maxpfds=0; int nrhand=0; int nwhand=0; int npfds=0; #ifdef HAVE_LIBWRAP int allow_severity=LOG_INFO; int deny_severity=LOG_WARNING; #endif int main(int argc, char **argv){ char buffer[MAX_INPUT_BUFFER]; int result; uid_t uid=-1; gid_t gid=-1; #ifdef HAVE_SIGACTION struct sigaction sig_action; #endif /* process command-line arguments */ result=process_arguments(argc,argv); if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE){ if(result!=OK) printf("Incorrect command line arguments supplied\n"); printf("\n"); printf("NSCA - Nagios Service Check Acceptor\n"); printf("Copyright (c) 2009 Nagios Core Development Team and Community Contributors\n"); printf("Copyright (c) 2000-2009 Ethan Galstad\n"); printf("Version: %s\n",PROGRAM_VERSION); printf("Last Modified: %s\n",MODIFICATION_DATE); printf("License: GPL v2\n"); printf("Encryption Routines: "); #ifdef HAVE_LIBMCRYPT printf("AVAILABLE"); #else printf("NOT AVAILABLE"); #endif printf("\n"); #ifdef HAVE_LIBWRAP printf("TCP Wrappers Available\n"); #endif printf("\n"); } if(result!=OK || show_help==TRUE){ printf("Usage: %s -c [mode]\n",argv[0]); printf("\n"); printf("Options:\n"); printf(" = Name of config file to use\n"); printf(" [mode] = Determines how NSCA should run. Valid modes:\n"); printf(" --inetd = Run as a service under inetd or xinetd\n"); printf(" --daemon = Run as a standalone multi-process daemon\n"); printf(" --single = Run as a standalone single-process daemon (default)\n"); printf("\n"); printf("Notes:\n"); printf("This program is designed to accept passive check results from\n"); printf("remote hosts that use the send_nsca utility. Can run as a service\n"); printf("under inetd or xinetd (read the docs for info on this), or as a\n"); printf("standalone daemon.\n"); printf("\n"); } if(show_license==TRUE) display_license(); if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE) do_exit(STATE_UNKNOWN); /* open a connection to the syslog facility */ /* facility may be overridden later */ get_log_facility(NSCA_LOG_FACILITY); openlog("nsca",LOG_PID|LOG_NDELAY,log_facility); /* make sure the config file uses an absolute path */ if(config_file[0]!='/'){ /* save the name of the config file */ strncpy(buffer,config_file,sizeof(buffer)); buffer[sizeof(buffer)-1]='\0'; /* get absolute path of current working directory */ strcpy(config_file,""); getcwd(config_file,sizeof(config_file)); /* append a forward slash */ strncat(config_file,"/",sizeof(config_file)-2); config_file[sizeof(config_file)-1]='\0'; /* append the config file to the path */ strncat(config_file,buffer,sizeof(config_file)-strlen(config_file)-1); config_file[sizeof(config_file)-1]='\0'; } /* read the config file */ result=read_config_file(config_file); /* exit if there are errors... */ if(result==ERROR) do_exit(STATE_CRITICAL); /* generate the CRC 32 table */ generate_crc32_table(); /* how should we handle client connections? */ switch(mode){ case INETD: /* chroot if configured */ do_chroot(); /* if we're running under inetd, handle one connection and get out */ handle_connection(0,NULL); break; case MULTI_PROCESS_DAEMON: /* older style, mult-process daemon */ /* execution cascades below... */ install_child_handler(); /* | | | */ case SINGLE_PROCESS_DAEMON: /* | | V */ /* daemonize and start listening for requests... */ if(fork()==0){ /* we're a daemon - set up a new process group */ setsid(); /* handle signals */ #ifdef HAVE_SIGACTION sig_action.sa_sigaction = NULL; sig_action.sa_handler = sighandler; sigfillset(&sig_action.sa_mask); sig_action.sa_flags = SA_NODEFER|SA_RESTART; sigaction(SIGQUIT, &sig_action, NULL); sigaction(SIGTERM, &sig_action, NULL); sigaction(SIGHUP, &sig_action, NULL); #else /* HAVE_SIGACTION */ signal(SIGQUIT,sighandler); signal(SIGTERM,sighandler); signal(SIGHUP,sighandler); #endif /* HAVE_SIGACTION */ /* close standard file descriptors */ close(0); close(1); close(2); /* redirect standard descriptors to /dev/null */ open("/dev/null",O_RDONLY); open("/dev/null",O_WRONLY); open("/dev/null",O_WRONLY); /* get group information before chrooting */ get_user_info(nsca_user,&uid); get_group_info(nsca_group,&gid); /* write pid file */ if(write_pid_file(uid,gid)==ERROR) return STATE_CRITICAL; /* chroot if configured */ do_chroot(); /* drop privileges */ if(drop_privileges(nsca_user,uid,gid)==ERROR) do_exit(STATE_CRITICAL); do{ /* reset flags */ sigrestart=FALSE; sigshutdown=FALSE; /* wait for connections */ wait_for_connections(); if(sigrestart==TRUE){ /* free memory */ free_memory(); /* re-read the config file */ result=read_config_file(config_file); /* exit if there are errors... */ if(result==ERROR){ syslog(LOG_ERR,"Config file '%s' contained errors, bailing out...",config_file); break; } } }while(sigrestart==TRUE && sigshutdown==FALSE); /* remove pid file */ remove_pid_file(); syslog(LOG_NOTICE,"Daemon shutdown\n"); } break; default: break; } /* we are now running in daemon mode, or the connection handed over by inetd has been completed, so the parent process exits */ do_exit(STATE_OK); /* keep the compilers happy... */ return STATE_OK; } /* cleanup */ static void do_cleanup(void){ /* free memory */ free_memory(); /* close the command file if its still open */ if(command_file_fp!=NULL) close_command_file(); /*** CLEAR SENSITIVE INFO FROM MEMORY ***/ /* overwrite password */ clear_buffer(password,sizeof(password)); /* disguise decryption method */ decryption_method=-1; return; } /* free some memory */ static void free_memory(void){ if(nsca_user){ free(nsca_user); nsca_user=NULL; } if(nsca_group){ free(nsca_group); nsca_group=NULL; } if(nsca_chroot){ free(nsca_chroot); nsca_chroot=NULL; } if(pid_file){ free(pid_file); pid_file=NULL; } return; } /* exit cleanly */ static void do_exit(int return_code){ do_cleanup(); exit(return_code); } /* read in the configuration file */ static int read_config_file(char *filename){ FILE *fp; char input_buffer[MAX_INPUT_BUFFER]; char *varname; char *varvalue; int line; /* open the config file for reading */ fp=fopen(filename,"r"); /* exit if we couldn't open the config file */ if(fp==NULL){ syslog(LOG_ERR,"Could not open config file '%s' for reading\n",filename); return ERROR; } line=0; while(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){ line++; /* skip comments and blank lines */ if(input_buffer[0]=='#') continue; if(input_buffer[0]=='\0') continue; if(input_buffer[0]=='\n') continue; /* get the variable name */ varname=strtok(input_buffer,"="); if(varname==NULL){ syslog(LOG_ERR,"No variable name specified in config file '%s' - Line %d\n",filename,line); return ERROR; } /* get the variable value */ varvalue=strtok(NULL,"\n"); if(varvalue==NULL){ syslog(LOG_ERR,"No variable value specified in config file '%s' - Line %d\n",filename,line); return ERROR; } if(!strcmp(varname,"server_port")){ server_port=atoi(varvalue); if((server_port<1024 && (geteuid()!=0)) || server_port<0){ syslog(LOG_ERR,"Invalid port number specified in config file '%s' - Line %d\n",filename,line); return ERROR; } } else if(!strcmp(varname,"server_address")){ strncpy(server_address,varvalue,sizeof(server_address) - 1); server_address[sizeof(server_address)-1]='\0'; } else if(strstr(input_buffer,"command_file")){ if(strlen(varvalue)>sizeof(command_file)-1){ syslog(LOG_ERR,"Command file name is too long in config file '%s' - Line %d\n",filename,line); return ERROR; } strncpy(command_file,varvalue,sizeof(command_file)-1); command_file[sizeof(command_file)-1]='\0'; } else if(strstr(input_buffer,"alternate_dump_file")){ if(strlen(varvalue)>sizeof(alternate_dump_file)-1){ syslog(LOG_ERR,"Alternate dump file name is too long in config file '%s' - Line %d\n",filename,line); return ERROR; } strncpy(alternate_dump_file,varvalue,sizeof(alternate_dump_file)-1); alternate_dump_file[sizeof(alternate_dump_file)-1]='\0'; } else if(strstr(input_buffer,"password")){ if(strlen(varvalue)>sizeof(password)-1){ syslog(LOG_ERR,"Password is too long in config file '%s' - Line %d\n",filename,line); return ERROR; } strncpy(password,varvalue,sizeof(password)-1); password[sizeof(password)-1]='\0'; } else if(strstr(input_buffer,"decryption_method")){ decryption_method=atoi(varvalue); switch(decryption_method){ case ENCRYPT_NONE: case ENCRYPT_XOR: break; #ifdef HAVE_LIBMCRYPT case ENCRYPT_DES: case ENCRYPT_3DES: case ENCRYPT_CAST128: case ENCRYPT_CAST256: case ENCRYPT_XTEA: case ENCRYPT_3WAY: case ENCRYPT_BLOWFISH: case ENCRYPT_TWOFISH: case ENCRYPT_LOKI97: case ENCRYPT_RC2: case ENCRYPT_ARCFOUR: case ENCRYPT_RIJNDAEL128: case ENCRYPT_RIJNDAEL192: case ENCRYPT_RIJNDAEL256: case ENCRYPT_WAKE: case ENCRYPT_SERPENT: case ENCRYPT_ENIGMA: case ENCRYPT_GOST: case ENCRYPT_SAFER64: case ENCRYPT_SAFER128: case ENCRYPT_SAFERPLUS: break; #endif default: syslog(LOG_ERR,"Invalid decryption method (%d) in config file '%s' - Line %d\n",decryption_method,filename,line); #ifndef HAVE_LIBMCRYPT if(decryption_method>=2) syslog(LOG_ERR,"Daemon was not compiled with mcrypt library, so decryption is unavailable.\n"); #endif return ERROR; } } else if(strstr(input_buffer,"debug")){ if(atoi(varvalue)>0) debug=TRUE; else debug=FALSE; } else if(strstr(input_buffer,"aggregate_writes")){ if(atoi(varvalue)>0) aggregate_writes=TRUE; else aggregate_writes=FALSE; } else if(strstr(input_buffer,"check_result_path")){ if(strlen(varvalue)>MAX_INPUT_BUFFER-1){ syslog(LOG_ERR,"Check result path is too long in config file '%s' - Line %d\n",filename,line); return ERROR; } check_result_path=strdup(varvalue); int checkresult_test_fd=-1; char *checkresult_test=NULL; asprintf(&checkresult_test,"%s/nsca.test.%i",check_result_path,getpid()); checkresult_test_fd=open(checkresult_test,O_WRONLY|O_CREAT,S_IWUSR); if (checkresult_test_fd>0){ unlink(checkresult_test); } else { printf("error!\n"); syslog(LOG_ERR,"check_result_path config variable found, but directory not writeable.\n"); return ERROR; } } else if(strstr(input_buffer,"append_to_file")){ if(atoi(varvalue)>0) append_to_file=TRUE; else append_to_file=FALSE; } else if(!strcmp(varname,"max_packet_age")){ max_packet_age=strtoul(varvalue,NULL,10); if(max_packet_age>900){ syslog(LOG_ERR,"Max packet age cannot be greater than 15 minutes (900 seconds).\n"); return ERROR; } } else if(!strcmp(varname,"nsca_user")) nsca_user=strdup(varvalue); else if(!strcmp(varname,"nsca_group")) nsca_group=strdup(varvalue); else if(!strcmp(varname,"nsca_chroot")) nsca_chroot=strdup(varvalue); else if(!strcmp(varname,"pid_file")) pid_file=strdup(varvalue); else if(!strcmp(varname,"log_facility")){ if((get_log_facility(varvalue))==OK){ /* re-open log using new facility */ closelog(); openlog("nsca",LOG_PID|LOG_NDELAY,log_facility); } else syslog(LOG_WARNING,"Invalid log_facility specified in config file '%s' - Line %d\n",filename,line); } else{ syslog(LOG_ERR,"Unknown option specified in config file '%s' - Line %d\n",filename,line); return ERROR; } } /* close the config file */ fclose(fp); return OK; } /* determines facility to use with syslog */ int get_log_facility(char *varvalue){ if(!strcmp(varvalue,"kern")) log_facility=LOG_KERN; else if(!strcmp(varvalue,"user")) log_facility=LOG_USER; else if(!strcmp(varvalue,"mail")) log_facility=LOG_MAIL; else if(!strcmp(varvalue,"daemon")) log_facility=LOG_DAEMON; else if(!strcmp(varvalue,"auth")) log_facility=LOG_AUTH; else if(!strcmp(varvalue,"syslog")) log_facility=LOG_SYSLOG; else if(!strcmp(varvalue,"lrp")) log_facility=LOG_LPR; else if(!strcmp(varvalue,"news")) log_facility=LOG_NEWS; else if(!strcmp(varvalue,"uucp")) log_facility=LOG_UUCP; else if(!strcmp(varvalue,"cron")) log_facility=LOG_CRON; else if(!strcmp(varvalue,"authpriv")) log_facility=LOG_AUTHPRIV; else if(!strcmp(varvalue,"ftp")) log_facility=LOG_FTP; else if(!strcmp(varvalue,"local0")) log_facility=LOG_LOCAL0; else if(!strcmp(varvalue,"local1")) log_facility=LOG_LOCAL1; else if(!strcmp(varvalue,"local2")) log_facility=LOG_LOCAL2; else if(!strcmp(varvalue,"local3")) log_facility=LOG_LOCAL3; else if(!strcmp(varvalue,"local4")) log_facility=LOG_LOCAL4; else if(!strcmp(varvalue,"local5")) log_facility=LOG_LOCAL5; else if(!strcmp(varvalue,"local6")) log_facility=LOG_LOCAL6; else if(!strcmp(varvalue,"local7")) log_facility=LOG_LOCAL7; else{ log_facility=LOG_DAEMON; return ERROR; } return OK; } /* get rid of all the children we can... */ static void reap_children(int sig){ while(waitpid(-1,NULL,WNOHANG)>0); return; } /* install reap_children() signal handler */ static void install_child_handler(void){ struct sigaction sa; sa.sa_handler=reap_children; sa.sa_flags=SA_NOCLDSTOP; sigaction(SIGCHLD,&sa,NULL); return; } /* register a file descriptor to be polled for an event set */ static void register_poll(short events, int fd){ int i; /* if it's already in the list, just flag the events */ for(i=0;i maxpfds){ maxpfds++; pfds=realloc(pfds, sizeof(struct pollfd) * maxpfds); } pfds[npfds].fd=fd; pfds[npfds].events=events; pfds[npfds].revents=0; npfds++; } /* register a read handler */ static void register_read_handler(int fd, void (*fp)(int, void *), void *data){ int i; /* register our interest in this descriptor */ register_poll(POLLIN,fd); /* if it's already in the list, just update the handler */ for(i=0;i maxrhand){ maxrhand++; rhand=realloc(rhand, sizeof(struct handler_entry) * maxrhand); } rhand[nrhand].fd=fd; rhand[nrhand].handler=fp; rhand[nrhand].data=data; nrhand++; } /* register a write handler */ static void register_write_handler(int fd, void (*fp)(int, void *), void *data){ int i; /* register our interest in this descriptor */ register_poll(POLLOUT,fd); /* if it's already in the list, just update the handler */ for(i=0;i maxwhand){ maxwhand++; whand=realloc(whand, sizeof(struct handler_entry) * maxwhand); } whand[nwhand].fd=fd; whand[nwhand].handler=fp; whand[nwhand].data=data; nwhand++; } /* find read handler */ static int find_rhand(int fd){ int i; for(i=0;i=0) break; /* handle the error */ else{ /* bail out if necessary */ if(sigrestart==TRUE || sigshutdown==TRUE) return; /* try and handle temporary errors */ if(errno==EWOULDBLOCK || errno==EINTR || errno==ECHILD){ if(mode==MULTI_PROCESS_DAEMON) sleep(1); else return; } else break; } } /* hey, there was an error... */ if(new_sd<0){ /* log error to syslog facility */ syslog(LOG_ERR,"Network server accept failure (%d: %s)",errno,strerror(errno)); /* close socket prior to exiting */ close(sock); if(mode==MULTI_PROCESS_DAEMON) do_exit(STATE_CRITICAL); return; } #ifdef HAVE_LIBWRAP /* Check whether or not connections are allowed from this host */ request_init(&req,RQ_DAEMON,"nsca",RQ_FILE,new_sd,0); fromhost(&req); if(!hosts_access(&req)){ /* refuse the connection */ syslog(LOG_ERR, "refused connect from %s", eval_client(&req)); close(new_sd); return; } #endif /* fork() if we have to... */ if(mode==MULTI_PROCESS_DAEMON){ pid=fork(); if(pid){ /* parent doesn't need the new connection */ close(new_sd); return; } else{ /* child does not need to listen for connections */ close(sock); } } /* find out who just connected... */ addrlen=sizeof(addr); rc=getpeername(new_sd,&addr,&addrlen); if(rc<0){ /* log error to syslog facility */ syslog(LOG_ERR,"Error: Network server getpeername() failure (%d: %s)",errno,strerror(errno)); /* close socket prior to exiting */ close(new_sd); if(mode==MULTI_PROCESS_DAEMON) do_exit(STATE_CRITICAL); return; } nptr=(struct sockaddr_in *)&addr; /* log info to syslog facility */ if(debug==TRUE) syslog(LOG_DEBUG,"Connection from %s port %d",inet_ntoa(nptr->sin_addr),nptr->sin_port); /* handle the connection */ if(mode==SINGLE_PROCESS_DAEMON) /* mark the connection as ready to be handled */ register_write_handler(new_sd, handle_connection, NULL); else /* handle the client connection */ handle_connection(new_sd, NULL); return; } /* handle a client connection */ static void handle_connection(int sock, void *data){ init_packet send_packet; int bytes_to_send; int rc; int flags; time_t packet_send_time; struct crypt_instance *CI; /* log info to syslog facility */ if(debug==TRUE) syslog(LOG_INFO,"Handling the connection..."); /* socket should be non-blocking */ fcntl(sock,F_GETFL,&flags); fcntl(sock,F_SETFL,flags|O_NONBLOCK); /* initialize encryption/decryption routines (server generates the IV to use and send to the client) */ if(encrypt_init(password,decryption_method,NULL,&CI)!=OK){ close(sock); if(mode==MULTI_PROCESS_DAEMON) do_exit(STATE_CRITICAL); return; } /* create initial packet to send to client (contains random IV and timestamp) */ memcpy(&send_packet.iv[0],CI->transmitted_iv,TRANSMITTED_IV_SIZE); time(&packet_send_time); send_packet.timestamp=(u_int32_t)htonl(packet_send_time); /* send client the initial packet */ bytes_to_send=sizeof(send_packet); rc=sendall(sock,(char *)&send_packet,&bytes_to_send); /* there was an error sending the packet */ if(rc==-1){ syslog(LOG_ERR,"Could not send init packet to client\n"); encrypt_cleanup(decryption_method,CI); close(sock); if(mode==MULTI_PROCESS_DAEMON) do_exit(STATE_CRITICAL); return; } /* for some reason we didn't send all the bytes we were supposed to */ else if(bytes_to_send0 && (packet_age>max_packet_age) && (packet_age>=0)) || ((max_packet_age>0) && (packet_age<(0-max_packet_age)) && (packet_age < 0)) ){ syslog(LOG_ERR,"Dropping packet with stale timestamp for %s - packet was %lu seconds old.",host_name,packet_age); close(sock); if(mode==SINGLE_PROCESS_DAEMON) return; else do_exit(STATE_OK); } /**** GET THE SERVICE CHECK INFORMATION ****/ /* plugin return code */ return_code=ntohs(receive_packet.return_code); /* service description */ strncpy(svc_description,receive_packet.svc_description,sizeof(svc_description)-1); svc_description[sizeof(svc_description)-1]='\0'; /* plugin output */ strncpy(plugin_output,receive_packet.plugin_output,plugin_length-1); plugin_output[plugin_length-1]='\0'; /* log info to syslog facility */ if(debug==TRUE){ if(!strcmp(svc_description,"")) syslog(LOG_NOTICE,"HOST CHECK -> Host Name: '%s', Return Code: '%d', Output: '%s'",host_name,return_code,plugin_output); else syslog(LOG_NOTICE,"SERVICE CHECK -> Host Name: '%s', Service Description: '%s', Return Code: '%d', Output: '%s'",host_name,svc_description,return_code,plugin_output); } /* write the check result to the external command file. * Note: it's OK to hang at this point if the write doesn't succeed, as there's * no way we could handle any other connection properly anyway. so we don't * use poll() - which fails on a pipe with any data, so it would cause us to * only ever write one command at a time into the pipe. */ //syslog(LOG_ERR,"'%s' (%s) []",check_result_path, strlen(check_result_path)); if (check_result_path==NULL){ write_check_result(host_name,svc_description,return_code,plugin_output,time(NULL)); }else{ write_checkresult_file(host_name,svc_description,return_code,plugin_output,time(NULL)); } return; } /* writes service/host check results to the Nagios checkresult directory */ static int write_checkresult_file(char *host_name, char *svc_description, int return_code, char *plugin_output, time_t check_time){ if(debug==TRUE) syslog(LOG_ERR,"Attempting to write checkresult file"); mode_t new_umask=077; mode_t old_umask; time_t current_time; char *output_file=NULL; int checkresult_file_fd=-1; char *checkresult_file=NULL; char *checkresult_ok_file=NULL; FILE *checkresult_file_fp=NULL; FILE *checkresult_ok_file_fp=NULL; /* change and store umask */ old_umask=umask(new_umask); /* create safe checkresult file */ asprintf(&checkresult_file,"%s/cXXXXXX",check_result_path); checkresult_file_fd=mkstemp(checkresult_file); if(checkresult_file_fd>0){ checkresult_file_fp=fdopen(checkresult_file_fd,"w"); } else { syslog(LOG_ERR,"Unable to open and write checkresult file '%s', failing back to PIPE",checkresult_file); return write_check_result(host_name,svc_description,return_code,plugin_output,check_time); } if(debug==TRUE) syslog(LOG_ERR,"checkresult file '%s' open for write.",checkresult_file); time(¤t_time); fprintf(checkresult_file_fp,"### NSCA Passive Check Result ###\n"); fprintf(checkresult_file_fp,"# Time: %s",ctime(¤t_time)); fprintf(checkresult_file_fp,"file_time=%d\n\n",current_time); fprintf(checkresult_file_fp,"### %s Check Result ###\n",(svc_description=="")?"Host":"Service"); fprintf(checkresult_file_fp,"host_name=%s\n",host_name); if(strcmp(svc_description,"")) fprintf(checkresult_file_fp,"service_description=%s\n",svc_description); fprintf(checkresult_file_fp,"check_type=1\n"); fprintf(checkresult_file_fp,"scheduled_check=0\n"); fprintf(checkresult_file_fp,"reschedule_check=0\n"); /* We have no latency data at this point. */ fprintf(checkresult_file_fp,"latency=0\n"); fprintf(checkresult_file_fp,"start_time=%lu.%lu\n",check_time,0L); fprintf(checkresult_file_fp,"finish_time=%lu.%lu\n",check_time,0L); fprintf(checkresult_file_fp,"return_code=%d\n",return_code); /* newlines in output are already escaped */ fprintf(checkresult_file_fp,"output=%s\n",(plugin_output==NULL)?"":plugin_output); fprintf(checkresult_file_fp,"\n"); fclose(checkresult_file_fp); /* create and close ok file */ asprintf(&checkresult_ok_file,"%s.ok",checkresult_file); syslog(LOG_DEBUG,"checkresult completion file '%s' open.",checkresult_ok_file); checkresult_ok_file_fp = fopen(checkresult_ok_file,"w"); fclose(checkresult_ok_file_fp); /* reset umask */ umask(old_umask); return OK; } /* writes service/host check results to the Nagios command file */ static int write_check_result(char *host_name, char *svc_description, int return_code, char *plugin_output, time_t check_time){ if(debug==TRUE) syslog(LOG_ERR,"Attempting to write to nagios command pipe"); if(aggregate_writes==FALSE){ if(open_command_file()==ERROR) return ERROR; } if(!strcmp(svc_description,"")) fprintf(command_file_fp,"[%lu] PROCESS_HOST_CHECK_RESULT;%s;%d;%s\n",(unsigned long)check_time,host_name,return_code,plugin_output); else{ fprintf(command_file_fp,"[%lu] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n",(unsigned long)check_time,host_name,svc_description,return_code,plugin_output); } if(aggregate_writes==FALSE) close_command_file(); else /* if we don't fflush() then we're writing in 4k non-CR-terminated blocks, and * anything else (eg. pscwatch) which writes to the file will be writing into * the middle of our commands. */ fflush(command_file_fp); return OK; } /* opens the command file for writing */ static int open_command_file(void) { int fd; /* file is already open */ if(command_file_fp!=NULL && using_alternate_dump_file==FALSE) return OK; do fd = open(command_file,O_WRONLY|((append_to_file==TRUE)?O_APPEND:0)); while(fd < 0 && errno == EINTR); /* command file doesn't exist - monitoring app probably isn't running... */ if (fd < 0 && errno == ENOENT) { if (debug == TRUE) syslog(LOG_ERR, "Command file '%s' does not exist, attempting to use alternate dump file '%s' for output", command_file, alternate_dump_file); /* try and write checks to alternate dump file */ command_file_fp = fopen(alternate_dump_file, "a"); if (command_file_fp == NULL) { if(debug == TRUE) syslog(LOG_ERR, "Could not open alternate dump file '%s' for appending", alternate_dump_file); return ERROR; } using_alternate_dump_file = TRUE; return OK; } if (fd < 0 || (command_file_fp = fdopen(fd, (append_to_file == TRUE) ? "a" : "w")) == NULL) { if (debug == TRUE) syslog(LOG_ERR, "Could not open command file '%s' for %s", command_file, (append_to_file == TRUE) ? "appending" : "writing"); return ERROR; } using_alternate_dump_file = FALSE; return OK; } /* closes the command file */ static void close_command_file(void){ fclose(command_file_fp); command_file_fp=NULL; return; } /* process command line arguments */ int process_arguments(int argc, char **argv){ int x; if(argc<2){ show_help=TRUE; return OK; } /* process arguments */ for(x=2;x<=argc;x++){ /* show usage */ if(!strcmp(argv[x-1],"-h") || !strcmp(argv[x-1],"--help")) show_help=TRUE; /* show license */ else if(!strcmp(argv[x-1],"-l") || !strcmp(argv[x-1],"--license")) show_license=TRUE; /* show version */ else if(!strcmp(argv[x-1],"-V") || !strcmp(argv[x-1],"--version")) show_version=TRUE; else if(!strcmp(argv[x-1],"-d") || !strcmp(argv[x-1],"--daemon")) mode=MULTI_PROCESS_DAEMON; else if(!strcmp(argv[x-1],"-s") || !strcmp(argv[x-1],"--single")) mode=SINGLE_PROCESS_DAEMON; else if(!strcmp(argv[x-1],"-i") || !strcmp(argv[x-1],"--inetd")) mode=INETD; /* config file */ else if(!strcmp(argv[x-1],"-c")){ if(x=0){ result=read(fd,pbuf,(sizeof pbuf)-1); close(fd); if(result>0){ pbuf[result]='\x0'; pid=(pid_t)atoi(pbuf); /* if previous process is no longer running running, remove the old pid file */ if(pid && (pid==getpid() || kill(pid,0)<0)) unlink(pid_file); /* previous process is still running */ else{ syslog(LOG_ERR,"There's already an NSCA server running (PID %lu). Bailing out...",(unsigned long)pid); return ERROR; } } } /* write new pid file */ if((fd=open(pid_file,O_WRONLY | O_CREAT,0644))>=0){ sprintf(pbuf,"%d\n",(int)getpid()); write(fd,pbuf,strlen(pbuf)); fchown(fd,usr,grp); close(fd); wrote_pid_file=TRUE; } else{ syslog(LOG_ERR,"Cannot write to pidfile '%s' - check your privileges.",pid_file); } return OK; } /* remove pid file */ static int remove_pid_file(void){ /* no pid file was specified */ if(pid_file==NULL) return OK; /* pid file was not written */ if(wrote_pid_file==FALSE) return OK; /* remove existing pid file */ if(unlink(pid_file)==-1){ syslog(LOG_ERR,"Cannot remove pidfile '%s' - check your privileges.",pid_file); return ERROR; } return OK; } /* get user information */ static int get_user_info(const char *user, uid_t *uid){ const struct passwd *pw=NULL; if(user!=NULL){ /* see if this is a user name */ if(strspn(user,"0123456789")pw_uid); else syslog(LOG_ERR,"Warning: Could not get passwd entry for '%s'",user); endpwent(); } /* else we were passed the UID */ else *uid=(uid_t)atoi(user); } else *uid=geteuid(); return OK; } /* get group information */ static int get_group_info(const char *group, gid_t *gid){ const struct group *grp=NULL; /* get group ID */ if(group!=NULL){ /* see if this is a group name */ if(strspn(group,"0123456789")gr_gid); else syslog(LOG_ERR,"Warning: Could not get group entry for '%s'",group); endgrent(); } /* else we were passed the GID */ else *gid=(gid_t)atoi(group); } else *gid=getegid(); return OK; } /* drops privileges */ static int drop_privileges(const char *user, uid_t uid, gid_t gid){ struct group *grp; struct passwd *pw; /* only drop privileges if we're running as root, so we don't interfere with being debugged while running as some random user */ if(getuid()!=0) return OK; /* set effective group ID if other than current EGID */ if(gid!=getegid()){ if(setgid(gid)==-1){ syslog(LOG_ERR,"Warning: Could not set effective GID=%d",(int)gid); return ERROR; } } #ifdef HAVE_INITGROUPS if(uid!=geteuid()){ /* initialize supplementary groups */ if(initgroups(user,gid)==-1){ if(errno==EPERM) syslog(LOG_ERR,"Warning: Unable to change supplementary groups using initgroups()"); else{ syslog(LOG_ERR,"Warning: Possibly root user failed dropping privileges with initgroups()"); return ERROR; } } } #endif if(setuid(uid)==-1){ syslog(LOG_ERR,"Warning: Could not set effective UID=%d",(int)uid); return ERROR; } return OK; } /* perform the chroot() operation if configured to do so */ void do_chroot(void){ int retval=0; const char *err=NULL; if(nsca_chroot!=NULL){ retval=chdir(nsca_chroot); if(retval!=0){ err=strerror(errno); syslog(LOG_ERR, "can not chdir into chroot directory: %s", err); do_exit(STATE_UNKNOWN); } retval=chroot("."); if(retval!=0){ err=strerror(errno); syslog(LOG_ERR, "can not chroot: %s", err); do_exit(STATE_UNKNOWN); } } } /* handle signals */ void sighandler(int sig){ static char *sigs[]={"EXIT","HUP","INT","QUIT","ILL","TRAP","ABRT","BUS","FPE","KILL","USR1","SEGV","USR2","PIPE","ALRM","TERM","STKFLT","CHLD","CONT","STOP","TSTP","TTIN","TTOU","URG","XCPU","XFSZ","VTALRM","PROF","WINCH","IO","PWR","UNUSED","ZERR","DEBUG",(char *)NULL}; int i; char temp_buffer[MAX_INPUT_BUFFER]; if(sig<0) sig=-sig; for(i=0;sigs[i]!=(char *)NULL;i++); sig%=i; /* we received a SIGHUP, so restart... */ if(sig==SIGHUP){ sigrestart=TRUE; syslog(LOG_NOTICE,"Caught SIGHUP - restarting...\n"); } /* else begin shutting down... */ if(sig==SIGTERM){ /* if shutdown is already true, we're in a signal trap loop! */ if(sigshutdown==TRUE) exit(STATE_CRITICAL); sigshutdown=TRUE; syslog(LOG_NOTICE,"Caught SIG%s - shutting down...\n",sigs[sig]); } return; } nsca-2.9.2/src/send_nsca.c000066400000000000000000000371201302203100700153270ustar00rootroot00000000000000/********************************************************************************** * * SEND_NSCA.C - NSCA Client * License: GPL v2 * Copyright (c) 2000-2007 Ethan Galstad (nagios@nagios.org) * * Last Modified: 12-07-2016 * * Command line: SEND_NSCA [-p port] [-to to_sec] [-c config_file] * * Description: * * *********************************************************************************/ /*#define DEBUG*/ #include "../include/common.h" #include "../include/config.h" #include "../include/netutils.h" #include "../include/utils.h" time_t start_time,end_time; int server_port=DEFAULT_SERVER_PORT; char server_name[MAX_HOST_ADDRESS_LENGTH]; char password[MAX_INPUT_BUFFER]=""; char config_file[MAX_INPUT_BUFFER]="send_nsca.cfg"; char delimiter[2]="\t"; char block_delimiter[2]=BLOCK_DELIMITER; char received_iv[TRANSMITTED_IV_SIZE]; int socket_timeout=DEFAULT_SOCKET_TIMEOUT; int warning_time=0; int check_warning_time=FALSE; int critical_time=0; int check_critical_time=FALSE; int encryption_method=ENCRYPT_XOR; time_t packet_timestamp; struct crypt_instance *CI=NULL; int show_help=FALSE; int show_license=FALSE; int show_version=FALSE; int process_arguments(int,char **); int read_config_file(char *); int read_init_packet(int); void alarm_handler(int); void clear_password(void); static void do_exit(int); int main(int argc, char **argv){ int sd; int rc; int result; data_packet send_packet; int bytes_to_send; char input[MAX_INPUT_BUFFER]; char input_buffer[MAX_INPUT_BUFFER]; char *temp_ptr; char host_name[MAX_HOSTNAME_LENGTH]; char svc_description[MAX_DESCRIPTION_LENGTH]; char plugin_output[MAX_PLUGINOUTPUT_LENGTH]; int total_packets=0; int16_t return_code; u_int32_t calculated_crc32; char *inputptr, *ptr1, *ptr2, *ptr3, *ptr4; #ifdef HAVE_SIGACTION struct sigaction sig_action; #endif /* process command-line arguments */ result=process_arguments(argc,argv); if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE){ if(result!=OK) printf("Incorrect command line arguments supplied\n"); printf("\n"); printf("NSCA Client %s\n",PROGRAM_VERSION); printf("Copyright (c) 2000-2007 Ethan Galstad (www.nagios.org)\n"); printf("Last Modified: %s\n",MODIFICATION_DATE); printf("License: GPL v2\n"); printf("Encryption Routines: "); #ifdef HAVE_LIBMCRYPT printf("AVAILABLE"); #else printf("NOT AVAILABLE"); #endif printf("\n"); printf("\n"); } if(result!=OK || show_help==TRUE){ printf("Usage: %s -H [-p port] [-to to_sec] [-d delim] [-c config_file]\n",argv[0]); printf("\n"); printf("Options:\n"); printf(" = The IP address of the host running the NSCA daemon\n"); printf(" [port] = The port on which the daemon is running - default is %d\n",DEFAULT_SERVER_PORT); printf(" [to_sec] = Number of seconds before connection attempt times out.\n"); printf(" (default timeout is %d seconds)\n",DEFAULT_SOCKET_TIMEOUT); printf(" [delim] = Delimiter to use when parsing input (defaults to a tab)\n"); printf(" [config_file] = Name of config file to use\n"); printf("\n"); printf("Note:\n"); printf("This utility is used to send passive check results to the NSCA daemon. Host and\n"); printf("Service check data that is to be sent to the NSCA daemon is read from standard\n"); printf("input. Input should be provided in the following format (tab-delimited unless\n"); printf("overriden with -d command line argument, one entry per line):\n"); printf("\n"); printf("Service Checks:\n"); printf("[tab][tab][tab][newline]\n\n"); printf("Host Checks:\n"); printf("[tab][tab][newline]\n\n"); printf("When submitting multiple simultaneous results, separate each set with the ETB\n"); printf("character (^W or 0x17)\n"); } if(show_license==TRUE) display_license(); if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE) do_exit(STATE_UNKNOWN); /* read the config file */ result=read_config_file(config_file); /* exit if there are errors... */ if(result==ERROR){ printf("Error: Config file '%s' contained errors...\n",config_file); do_exit(STATE_CRITICAL); } /* generate the CRC 32 table */ generate_crc32_table(); /* initialize alarm signal handling */ #ifdef HAVE_SIGACTION sig_action.sa_sigaction = NULL; sig_action.sa_handler = alarm_handler; sigfillset(&sig_action.sa_mask); sig_action.sa_flags = SA_NODEFER|SA_RESTART; sigaction(SIGALRM, &sig_action, NULL); #else signal(SIGALRM,alarm_handler); #endif /* HAVE_SIGACTION */ /* set socket timeout */ alarm(socket_timeout); time(&start_time); /* try to connect to the host at the given port number */ result=my_tcp_connect(server_name,server_port,&sd); /* we couldn't connect */ if(result!=STATE_OK){ printf("Error: Could not connect to host %s on port %d\n",server_name,server_port); do_exit(STATE_CRITICAL); } #ifdef DEBUG printf("Connected okay...\n"); #endif /* read the initialization packet containing the IV and timestamp */ result=read_init_packet(sd); if(result!=OK){ printf("Error: Could not read init packet from server\n"); close(sd); do_exit(STATE_CRITICAL); } #ifdef DEBUG printf("Got init packet from server\n"); #endif /* initialize encryption/decryption routines with the IV we received from the server */ if(encrypt_init(password,encryption_method,received_iv,&CI)!=OK){ printf("Error: Failed to initialize encryption libraries for method %d\n",encryption_method); close(sd); do_exit(STATE_CRITICAL); } #ifdef DEBUG printf("Initialized encryption routines\n"); #endif /**** WE'RE CONNECTED AND READY TO SEND ****/ /* read all data from STDIN until there isn't anymore */ while(!feof(stdin)){ int c = getc(stdin); if (c == -1){ break; } int pos = 0; while (c != 23){ if (c == -1){ // in case we don't terminate properly // or are in single-input mode. break; } input_buffer[pos] = c; c = getc(stdin); pos++; } input_buffer[pos] = 0; strip(input_buffer); if(!strcmp(input_buffer,"")) continue; /* get the host name */ ptr1=strtok(input_buffer,delimiter); if(ptr1==NULL) continue; /* get the service description or return code */ ptr2=strtok(NULL,delimiter); if(ptr2==NULL) continue; /* get the return code or plugin output */ ptr3=strtok(NULL,delimiter); if(ptr3==NULL) continue; /* get the plugin output - if NULL, this is a host check result */ ptr4=strtok(NULL,"\x0"); strncpy(host_name,ptr1,sizeof(host_name)-1); host_name[sizeof(host_name)-1]='\x0'; if(ptr4==NULL){ strcpy(svc_description,""); return_code=atoi(ptr2); ptr3=escape_newlines(ptr3); strncpy(plugin_output,ptr3,sizeof(plugin_output)-1); } else{ strncpy(svc_description,ptr2,sizeof(svc_description)-1); return_code=atoi(ptr3); ptr4=escape_newlines(ptr4); strncpy(plugin_output,ptr4,sizeof(plugin_output)-1); } svc_description[sizeof(svc_description)-1]='\x0'; plugin_output[sizeof(plugin_output)-1]='\x0'; /* increment count of packets we're sending */ total_packets++; /* clear the packet buffer */ bzero(&send_packet,sizeof(send_packet)); /* fill the packet with semi-random data */ randomize_buffer((char *)&send_packet,sizeof(send_packet)); /* copy the data we want to send into the packet */ send_packet.packet_version=(int16_t)htons(NSCA_PACKET_VERSION_3); send_packet.return_code=(int16_t)htons(return_code); strcpy(&send_packet.host_name[0],host_name); strcpy(&send_packet.svc_description[0],svc_description); strcpy(&send_packet.plugin_output[0],plugin_output); /* use timestamp provided by the server */ send_packet.timestamp=(u_int32_t)htonl(packet_timestamp); /* calculate the crc 32 value of the packet */ send_packet.crc32_value=(u_int32_t)0L; calculated_crc32=calculate_crc32((char *)&send_packet,sizeof(send_packet)); send_packet.crc32_value=(u_int32_t)htonl(calculated_crc32); /* encrypt the packet */ encrypt_buffer((char *)&send_packet,sizeof(send_packet),password,encryption_method,CI); /* send the packet */ bytes_to_send=sizeof(send_packet); rc=sendall(sd,(char *)&send_packet,&bytes_to_send); /* there was an error sending the packet */ if(rc==-1){ printf("Error: Could not send data to host\n"); close(sd); do_exit(STATE_UNKNOWN); } /* for some reason we didn't send all the bytes we were supposed to */ else if(bytes_to_send2) return ERROR; } return OK; } /* handle timeouts */ void alarm_handler(int sig){ const char msg[] = "Error: Timeout after %d seconds\n"; /* printf("Error: Timeout after %d seconds\n",socket_timeout); */ write(STDOUT_FILENO, msg, sizeof(msg) - 1); do_exit(STATE_CRITICAL); } /* read in the configuration file */ int read_config_file(char *filename){ FILE *fp; char input_buffer[MAX_INPUT_BUFFER]; char *temp_buffer; char *varname; char *varvalue; int line; /* open the config file for reading */ fp=fopen(filename,"r"); /* exit if we couldn't open the config file */ if(fp==NULL){ printf("Could not open config file '%s' for reading.\n",filename); return ERROR; } line=0; while(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){ line++; /* skip comments and blank lines */ if(input_buffer[0]=='#') continue; if(input_buffer[0]=='\x0') continue; if(input_buffer[0]=='\n') continue; /* get the variable name */ varname=strtok(input_buffer,"="); if(varname==NULL){ printf("No variable name specified in config file '%s' - Line %d\n",filename,line); return ERROR; } /* get the variable value */ varvalue=strtok(NULL,"\n"); if(varvalue==NULL){ printf("No variable value specified in config file '%s' - Line %d\n",filename,line); return ERROR; } if(strstr(input_buffer,"password")){ if(strlen(varvalue)>sizeof(password)-1){ printf("Password is too long in config file '%s' - Line %d\n",filename,line); return ERROR; } strncpy(password,varvalue,sizeof(password)); password[sizeof(password)-1]='\x0'; } else if(strstr(input_buffer,"encryption_method")){ encryption_method=atoi(varvalue); switch(encryption_method){ case ENCRYPT_NONE: break; case ENCRYPT_XOR: break; #ifdef HAVE_LIBMCRYPT case ENCRYPT_DES: break; case ENCRYPT_3DES: break; case ENCRYPT_CAST128: break; case ENCRYPT_CAST256: break; case ENCRYPT_XTEA: break; case ENCRYPT_3WAY: break; case ENCRYPT_BLOWFISH: break; case ENCRYPT_TWOFISH: break; case ENCRYPT_LOKI97: break; case ENCRYPT_RC2: break; case ENCRYPT_ARCFOUR: break; case ENCRYPT_RIJNDAEL128: break; case ENCRYPT_RIJNDAEL192: break; case ENCRYPT_RIJNDAEL256: break; case ENCRYPT_WAKE: break; case ENCRYPT_SERPENT: break; case ENCRYPT_ENIGMA: break; case ENCRYPT_GOST: break; case ENCRYPT_SAFER64: break; case ENCRYPT_SAFER128: break; case ENCRYPT_SAFERPLUS: break; #endif default: printf("Invalid encryption method (%d) in config file '%s' - Line %d\n",encryption_method,filename,line); #ifndef HAVE_LIBMCRYPT if(encryption_method>=2) printf("Client was not compiled with mcrypt library, so encryption is unavailable.\n"); #endif return ERROR; } } else{ printf("Unknown option specified in config file '%s' - Line %d\n",filename,line); return ERROR; } } /* close the config file */ fclose(fp); return OK; } nsca-2.9.2/src/utils.c000066400000000000000000000355141302203100700145370ustar00rootroot00000000000000/**************************************************************************** * * UTILS.C - Utility functions for NSCA * * License: GPL * Copyright (c) 2000-2008 Ethan Galstad (nagios@nagios.org) * * Last Modified: 01-15-2008 * * Description: * * This file contains common unctions used in nsca and send_nsca * * License Information: * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * ****************************************************************************/ #include "../include/common.h" #include "../include/utils.h" /*#define DEBUG*/ static unsigned long crc32_table[256]; #ifdef HAVE_LIBMCRYPT static volatile sig_atomic_t mcrypt_initialized=FALSE; #endif /* escapes newlines in a string, snagged from nagios-3.0.6/base/utils.c */ char *escape_newlines(char *rawbuf){ char *newbuf=NULL; register int x,y; if(rawbuf==NULL) return NULL; /* allocate enough memory to escape all chars if necessary */ if((newbuf=malloc((strlen(rawbuf)*2)+1))==NULL) return NULL; for(x=0,y=0;rawbuf[x]!=(char)'\x0';x++){ /* escape backslashes */ if(rawbuf[x]=='\\'){ newbuf[y++]='\\'; newbuf[y++]='\\'; } /* escape newlines */ else if(rawbuf[x]=='\n'){ newbuf[y++]='\\'; newbuf[y++]='n'; } else newbuf[y++]=rawbuf[x]; } newbuf[y]='\x0'; return newbuf; } /* build the crc table - must be called before calculating the crc value */ void generate_crc32_table(void){ unsigned long crc, poly; int i, j; poly=0xEDB88320L; for(i=0;i<256;i++){ crc=i; for(j=8;j>0;j--){ if(crc & 1) crc=(crc>>1)^poly; else crc>>=1; } crc32_table[i]=crc; } return; } /* calculates the CRC 32 value for a buffer */ unsigned long calculate_crc32(char *buffer, int buffer_size){ register unsigned long crc; int this_char; int current_index; crc=0xFFFFFFFF; for(current_index=0;current_index>8) & 0x00FFFFFF) ^ crc32_table[(crc ^ this_char) & 0xFF]; } return (crc ^ 0xFFFFFFFF); } /* initializes encryption routines */ int encrypt_init(char *password,int encryption_method,char *received_iv,struct crypt_instance **CIptr){ #ifdef HAVE_LIBMCRYPT int i; int iv_size; #endif struct crypt_instance *CI; CI=malloc(sizeof(struct crypt_instance)); *CIptr=CI; if(CI==NULL){ syslog(LOG_ERR, "Could not allocate memory for crypt instance"); return ERROR; } /* server generates IV used for encryption */ if(received_iv==NULL) generate_transmitted_iv(CI->transmitted_iv); /* client recieves IV from server */ else memcpy(CI->transmitted_iv,received_iv,TRANSMITTED_IV_SIZE); #ifdef HAVE_LIBMCRYPT CI->blocksize=1; /* block size = 1 byte w/ CFB mode */ CI->keysize=7; /* default to 56 bit key length */ CI->mcrypt_mode="cfb"; /* CFB = 8-bit cipher-feedback mode */ CI->mcrypt_algorithm="unknown"; #endif /* XOR or no encryption */ if(encryption_method==ENCRYPT_NONE || encryption_method==ENCRYPT_XOR) return OK; #ifdef HAVE_LIBMCRYPT /* get the name of the mcrypt encryption algorithm to use */ switch(encryption_method){ case ENCRYPT_DES: CI->mcrypt_algorithm=MCRYPT_DES; break; case ENCRYPT_3DES: CI->mcrypt_algorithm=MCRYPT_3DES; break; case ENCRYPT_CAST128: CI->mcrypt_algorithm=MCRYPT_CAST_128; break; case ENCRYPT_CAST256: CI->mcrypt_algorithm=MCRYPT_CAST_256; break; case ENCRYPT_XTEA: CI->mcrypt_algorithm=MCRYPT_XTEA; break; case ENCRYPT_3WAY: CI->mcrypt_algorithm=MCRYPT_3WAY; break; case ENCRYPT_BLOWFISH: CI->mcrypt_algorithm=MCRYPT_BLOWFISH; break; case ENCRYPT_TWOFISH: CI->mcrypt_algorithm=MCRYPT_TWOFISH; break; case ENCRYPT_LOKI97: CI->mcrypt_algorithm=MCRYPT_LOKI97; break; case ENCRYPT_RC2: CI->mcrypt_algorithm=MCRYPT_RC2; break; case ENCRYPT_ARCFOUR: CI->mcrypt_algorithm=MCRYPT_ARCFOUR; break; case ENCRYPT_RIJNDAEL128: CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_128; break; case ENCRYPT_RIJNDAEL192: CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_192; break; case ENCRYPT_RIJNDAEL256: CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_256; break; case ENCRYPT_WAKE: CI->mcrypt_algorithm=MCRYPT_WAKE; break; case ENCRYPT_SERPENT: CI->mcrypt_algorithm=MCRYPT_SERPENT; break; case ENCRYPT_ENIGMA: CI->mcrypt_algorithm=MCRYPT_ENIGMA; break; case ENCRYPT_GOST: CI->mcrypt_algorithm=MCRYPT_GOST; break; case ENCRYPT_SAFER64: CI->mcrypt_algorithm=MCRYPT_SAFER_SK64; break; case ENCRYPT_SAFER128: CI->mcrypt_algorithm=MCRYPT_SAFER_SK128; break; case ENCRYPT_SAFERPLUS: CI->mcrypt_algorithm=MCRYPT_SAFERPLUS; break; default: CI->mcrypt_algorithm="unknown"; break; } #ifdef DEBUG syslog(LOG_INFO,"Attempting to initialize '%s' crypto algorithm...",CI->mcrypt_algorithm); #endif /* open encryption module */ if((CI->td=mcrypt_module_open(CI->mcrypt_algorithm,NULL,CI->mcrypt_mode,NULL))==MCRYPT_FAILED){ syslog(LOG_ERR,"Could not open mcrypt algorithm '%s' with mode '%s'",CI->mcrypt_algorithm,CI->mcrypt_mode); return ERROR; } #ifdef DEBUG syslog(LOG_INFO,"Using '%s' as crypto algorithm...",CI->mcrypt_algorithm); #endif /* determine size of IV buffer for this algorithm */ iv_size=mcrypt_enc_get_iv_size(CI->td); if(iv_size>TRANSMITTED_IV_SIZE){ syslog(LOG_ERR,"IV size for crypto algorithm exceeds limits"); return ERROR; } /* allocate memory for IV buffer */ if((CI->IV=(char *)malloc(iv_size))==NULL){ syslog(LOG_ERR,"Could not allocate memory for IV buffer"); return ERROR; } /* fill IV buffer with first bytes of IV that is going to be used to crypt (determined by server) */ for(i=0;iIV[i]=CI->transmitted_iv[i]; /* get maximum key size for this algorithm */ CI->keysize=mcrypt_enc_get_key_size(CI->td); /* generate an encryption/decription key using the password */ if((CI->key=(char *)malloc(CI->keysize))==NULL){ syslog(LOG_ERR,"Could not allocate memory for encryption/decryption key"); return ERROR; } bzero(CI->key,CI->keysize); if(CI->keysizekey,password,CI->keysize); else strncpy(CI->key,password,strlen(password)); /* initialize encryption buffers */ mcrypt_generic_init(CI->td,CI->key,CI->keysize,CI->IV); mcrypt_initialized=TRUE; #endif return OK; } /* encryption routine cleanup */ void encrypt_cleanup(int encryption_method, struct crypt_instance *CI){ /* no crypt instance */ if(CI==NULL) return; #ifdef HAVE_LIBMCRYPT /* mcrypt cleanup */ if(encryption_method!=ENCRYPT_NONE && encryption_method!=ENCRYPT_XOR){ if(mcrypt_initialized==TRUE) mcrypt_generic_end(CI->td); free(CI->key); CI->key=NULL; free(CI->IV); CI->IV=NULL; } #endif free(CI); return; } /* generates IV to use for encrypted communications (function is called by server only, client uses IV it receives from server) */ static void generate_transmitted_iv(char *transmitted_iv){ FILE *fp; int x; int seed=0; /*********************************************************/ /* fill IV buffer with data that's as random as possible */ /*********************************************************/ /* try to get seed value from /dev/urandom, as its a better source of entropy */ fp=fopen("/dev/urandom","r"); if(fp!=NULL){ seed=fgetc(fp); fclose(fp); } /* else fallback to using the current time as the seed */ else seed=(int)time(NULL); /* generate pseudo-random IV */ srand(seed); for(x=0;x=TRANSMITTED_IV_SIZE) x=0; buffer[y]^=CI->transmitted_iv[x]; } /* rotate over password... */ password_length=strlen(password); for(y=0,x=0;y=password_length) x=0; buffer[y]^=password[x]; } return; } #ifdef HAVE_LIBMCRYPT /* use mcrypt routines */ else{ /* encrypt each byte of buffer, one byte at a time (CFB mode) */ for(x=0;xtd,&buffer[x],1); } #endif return; } /* decrypt a buffer */ void decrypt_buffer(char *buffer,int buffer_size, char *password, int encryption_method, struct crypt_instance *CI){ int x=0; #ifdef DEBUG syslog(LOG_INFO,"Decrypting with algorithm #%d",encryption_method); #endif /* no crypt instance */ if(CI==NULL) return; /* no encryption */ if(encryption_method==ENCRYPT_NONE) return; /* XOR "decryption" is the same as encryption */ else if(encryption_method==ENCRYPT_XOR) encrypt_buffer(buffer,buffer_size,password,encryption_method,CI); #ifdef HAVE_LIBMCRYPT /* use mcrypt routines */ else{ /* encrypt each byte of buffer, one byte at a time (CFB mode) */ for(x=0;xtd,&buffer[x],1); } #endif return; } /* fill a buffer with semi-random data */ void randomize_buffer(char *buffer,int buffer_size){ FILE *fp; int x; int seed; /**** FILL BUFFER WITH RANDOM ALPHA-NUMERIC CHARACTERS ****/ /*************************************************************** Only use alpha-numeric characters becase plugins usually only generate numbers and letters in their output. We want the buffer to contain the same set of characters as plugins, so its harder to distinguish where the real output ends and the rest of the buffer (padded randomly) starts. ***************************************************************/ /* try to get seed value from /dev/urandom, as its a better source of entropy */ fp=fopen("/dev/urandom","r"); if(fp!=NULL){ seed=fgetc(fp); fclose(fp); } /* else fallback to using the current time as the seed */ else seed=(int)time(NULL); srand(seed); for(x=0;x=1;x--){ index=x-1; if(buffer[index]==' ' || buffer[index]=='\r' || buffer[index]=='\n' || buffer[index]=='\t') buffer[index]='\x0'; else break; } return; } /* wipes an area of memory clean */ void clear_buffer(char *buffer, int buffer_length){ /* NULL all bytes of buffer */ memset(buffer,'\x0',buffer_length); return; } /* show license */ void display_license(void){ printf("This program is free software; you can redistribute it and/or modify\n"); printf("it under the terms of the GNU General Public License as published by\n"); printf("the Free Software Foundation; either version 2 of the License, or\n"); printf("(at your option) any later version.\n\n"); printf("This program is distributed in the hope that it will be useful,\n"); printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); printf("GNU General Public License for more details.\n\n"); printf("You should have received a copy of the GNU General Public License\n"); printf("along with this program; if not, write to the Free Software\n"); printf("Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"); return; } nsca-2.9.2/subst.in000077500000000000000000000020221302203100700141230ustar00rootroot00000000000000#!/usr/bin/perl -w my ${exec_prefix}; my ${prefix}; ${prefix}="@prefix@"; ${exec_prefix}="@exec_prefix@"; while ($f = shift @ARGV) { if (-x "/bin/mktemp") { $TEMP = `/bin/mktemp $f.$$.XXXXXX`; die 'Cannot make temporary file $TEMP' if($?); chomp $TEMP; } else { $XXXXXX = rand; $TEMP = "$f.$$.$XXXXXX"; } open(IN,"<$f.in"); open(OUT,">$TEMP") || die 'Cannot make temporary file $TEMP'; while () { s|\@nsca_user\@|@nsca_user@|g; s|\@nsca_grp\@|@nsca_grp@|g; s|\@nsca_port\@|@nsca_port@|g; s|\@log_facility\@|@log_facility@|g; s|\@libexecdir\@|@libexecdir@|g; # put all --with-vars before directories s|\@localstatedir\@|@localstatedir@|g; s|\@sysconfdir\@|@sysconfdir@|g; s|\@datadir\@|@datadir@|g; s|\@sbindir\@|@sbindir@|g; s|\@bindir\@|@bindir@|g; s|\$\{exec_prefix\}|@exec_prefix@|g; # must be next to last s|\$\{prefix\}|@prefix@|g; # must be last print OUT $_; } close IN; close OUT; if ((! -e $f) || (`diff $f $TEMP`)) { `mv $TEMP $f`; } else { unlink $TEMP; } } nsca-2.9.2/update-version000077500000000000000000000042471302203100700153360ustar00rootroot00000000000000#!/bin/sh # Get date (two formats) if [ -n "$2" ]; then LONGDATE=`date -d "$2" "+%B %d, %Y"` SHORTDATE=`date -d "$2" "+%m-%d-%Y"` else LONGDATE=`date "+%B %d, %Y"` SHORTDATE=`date "+%m-%d-%Y"` fi # Current version number CURRENTVERSION=2.9.2 # Last date LASTDATE=12-07-2016 if [ "x$1" = "x" ] then echo "Usage: $0 [revision date]" echo "" echo "Run this script with the name of the new version (i.e \"2.6\") to" echo "update version number and modification date in files." echo "Use the \"newdate\" argument if you want to keep the current version" echo "number and just update the modification date." echo "" echo "Current version=$CURRENTVERSION" echo "Current Modification date=$LASTDATE" echo "" exit 1 fi newversion=$1 if [ "x$newversion" = "xnewdate" ] then newversion=$CURRENTVERSION fi # Update version number and release date in common code perl -i -p -e "s/VERSION \".*\"/VERSION \"$1\"/;" include/common.h perl -i -p -e "s/MODIFICATION_DATE \".*\"/MODIFICATION_DATE \"$SHORTDATE\"/;" include/common.h perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" include/common.h # Update version number and release date in main code perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/nsca.c perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/send_nsca.c # Update version number and release date in configure script and configure.ac perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure perl -i -p -e "if( /^AC_INIT/) { s/$CURRENTVERSION/$1/; }" configure.ac perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure.ac perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure.ac # Update RPM spec file with version number perl -i -p -e "s/%define version .*/%define version $1/;" nsca.spec # Update this file with version number and last date perl -i -p -e "s/^CURRENTVERSION=.*/CURRENTVERSION=$newversion/;" update-version perl -i -p -e "s/^LASTDATE=.*/LASTDATE=$SHORTDATE/;" update-version