ircd-hybrid-8.1.13.dfsg.1/0000755000175000017500000000000012263053456013213 5ustar domdomircd-hybrid-8.1.13.dfsg.1/AUTHORS0000644000175000017500000000472012263053414014260 0ustar domdom$Id: AUTHORS 2668 2013-12-13 19:59:04Z michael $ The hybrid team is a group of ircd coders who were frustrated with the instability and all-out "dirtiness" of the EFnet ircd's available. "hybrid" is the name for the collective efforts of a group of people, all of us. Anyone is welcome to contribute to this effort. You are encouraged to participate in the Hybrid mailing list. To subscribe to the Hybrid List, use this link: https://lists.ircd-hybrid.org/mailman/listinfo/hybrid The core team as, of this major release: billy-jon, William Bierman III cryogen, Stuart Walsh Dianora, Diane Bruce metalrock, Jack Low Michael, Michael Wobst Rodder, Jon Lusky Wohali, Joan Touzet The following people have contributed blood, sweat, and/or code to recent releases of Hybrid, in nick alphabetical order: A1kmm, Andrew Miller Adrian Chadd AndroSyn, Aaron Sethman bane, Dragan Dosen bysin, Ben Kittridge cosine, Patrick Alken David-T, David Taylor Dom, Dominic Hargreaves fgeek, Henri Salo fl, Lee Hardy Garion, Joost Vunderink Habeeb, David Supuran Hwy101, W. Campbell jmallett, Juli Mallett joshk, Joshua Kwan jv, Jakub Vlasek k9, Jeremy Chadwick kire, Erik Small knight, Alan LeVee kre, Dinko Korunic madmax, Paul Lomax Riedel, Dennis Vink, scuzzy, David Todd spookey, David Colburn TimeMr14C, Yusuf Iskenderoglu toot, Toby Verrall vx0, Mark Miller wiz, Jason Dambrosio Xride, Søren Straarup zb^3, Alfred Perlstein Others are welcome. Always. And if we left anyone off the above list, be sure to let us know that too. Many others have contributed to previous versions of this ircd and its ancestors, too many to list here. Send bug fixes/complaints/rotten tomatoes to bugs@ircd-hybrid.org. ircd-hybrid-8.1.13.dfsg.1/compile0000755000175000017500000001624512263053414014573 0ustar domdom#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ircd-hybrid-8.1.13.dfsg.1/config.h.in0000644000175000017500000002103212263053414015226 0ustar domdom/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Set to datadir. */ #undef DATADIR /* Define if SSP C support is enabled. */ #undef ENABLE_SSP_CC /* Define to 1 if you want halfops support. */ #undef HALFOPS /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DEVPOLL_H /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if libGeoIP (-lGeoIP) is available. */ #undef HAVE_LIBGEOIP /* Define to 1 if you have the `ssl' library (-lssl). */ #undef HAVE_LIBSSL /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strtok_r' function. */ #undef HAVE_STRTOK_R /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if the system has the type `struct sockaddr_in'. */ #undef HAVE_STRUCT_SOCKADDR_IN /* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */ #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN /* Define to 1 if the system has the type `struct sockaddr_storage'. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DEVPOLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the header file. */ #undef HAVE_WAIT_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define to 1 if you have IPv6 support. */ #undef IPV6 /* Set to libdir. */ #undef LIBDIR /* Set to localstatedir. */ #undef LOCALSTATEDIR /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Size of the auth mempool chunk. */ #undef MP_CHUNK_SIZE_AUTH /* Size of the ban mempool chunk. */ #undef MP_CHUNK_SIZE_BAN /* Size of the channel mempool chunk. */ #undef MP_CHUNK_SIZE_CHANNEL /* Size of the client mempool chunk. */ #undef MP_CHUNK_SIZE_CLIENT /* Size of the dbuf mempool chunk. */ #undef MP_CHUNK_SIZE_DBUF /* Size of the dlink_node mempool chunk. */ #undef MP_CHUNK_SIZE_DNODE /* Size of the dns mempool chunk. */ #undef MP_CHUNK_SIZE_DNS /* Size of the ip_entry mempool chunk. */ #undef MP_CHUNK_SIZE_IP_ENTRY /* Size of the local client mempool chunk. */ #undef MP_CHUNK_SIZE_LCLIENT /* Size of the channel-member mempool chunk. */ #undef MP_CHUNK_SIZE_MEMBER /* Size of the namehost mempool chunk. */ #undef MP_CHUNK_SIZE_NAMEHOST /* Size of the userhost mempool chunk. */ #undef MP_CHUNK_SIZE_USERHOST /* Size of the watch mempool chunk. */ #undef MP_CHUNK_SIZE_WATCH /* Define to disable assert() statements. */ #undef NDEBUG /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Size of the WHOWAS array. */ #undef NICKNAMEHISTORYLENGTH /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Set to prefix. */ #undef PREFIX /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Set to sysconfdir. */ #undef SYSCONFDIR /* use this iopoll mechanism */ #undef USE_IOPOLL_MECHANISM /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* devpoll mechanism */ #undef __IOPOLL_MECHANISM_DEVPOLL /* epoll mechanism */ #undef __IOPOLL_MECHANISM_EPOLL /* kqueue mechanism */ #undef __IOPOLL_MECHANISM_KQUEUE /* no iopoll mechanism */ #undef __IOPOLL_MECHANISM_NONE /* poll mechanism */ #undef __IOPOLL_MECHANISM_POLL /* select mechanism */ #undef __IOPOLL_MECHANISM_SELECT /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t ircd-hybrid-8.1.13.dfsg.1/README0000644000175000017500000000467012263053414014074 0ustar domdomContact Information: * Bug Reports: - bugs@ircd-hybrid.org * General Discussion and Support mailing list: - https://lists.ircd-hybrid.org/mailman/listinfo/hybrid - hybrid@lists.ircd-hybrid.org * IRC contact: - #ircd-coders on irc.ircd-hybrid.org ******************************* IMPORTANT ************************************* ************ Note for those who don't bother reading docs *************** * - Reading INSTALL is now a must, as the old DPATH is now specified * * when configure is run. * * You now need to ./configure --prefix="/path/to/install/it" * * - The old config format WILL NOT WORK. Please see doc/reference.conf !* * - The old kline, dline, xline format WILL NOT WORK. * ************************************************************************* ALSO, IF YOU ARE UPGRADING YOUR CURRENT SOURCE TREE, AND YOU TRY TO BUILD IN IT WITHOUT PERFORMING AT LEAST 'make clean', THINGS _WILL_ BREAK. IT IS RECOMMENDED THAT YOU RUN 'make distclean' AND THEN RERUN './configure'! ******************************* REQUIREMENTS ********************************** Necessary Requirements: - A supported platform (look below) - A working dynamic load library Feature Specific Requirements: - For the SSL Challenge controlled OPER feature, compressed and/or SSL/TLS server links, as well as SSL/TLS client connections, a working OpenSSL library is required - For encrypted oper, server and auth passwords, a working DES, MD5, or SHA library - For ISO 3166 alpha-2 two letter country code enabled resv{} blocks, a working libGeoIP is required ******************************************************************************* - See the INSTALL document for info on configuring and compiling ircd-hybrid. - Please read doc/index.txt to get an overview of the current documentation. - TESTED PLATFORMS: The code has been tested on the following platforms, and is known to run properly. (FIXME: this list is out of date) CentOS 5.8 Red Hat Linux 9 Ubuntu 12.04 FreeBSD 9.1 OpenBSD 5.2 Arch Linux 2012.12.01 Debian GNU/Hurd 0.3 - /etc/resolv.conf must exist for the resolver to work. - Please read NEWS for information about what is in this release. - Other files recommended for reading: INSTALL -------------------------------------------------------------------------------- $Id: README 2343 2013-07-03 18:13:17Z michael $ ircd-hybrid-8.1.13.dfsg.1/include/0000755000175000017500000000000012263053456014636 5ustar domdomircd-hybrid-8.1.13.dfsg.1/include/s_gline.h0000644000175000017500000000331512263053413016422 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_gline.h: A header for the gline functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_gline.h 1798 2013-03-31 17:09:50Z michael $ */ #ifndef INCLUDED_s_gline_h #define INCLUDED_s_gline_h #include "ircd_defs.h" #define GLINE_PENDING_DEL_TYPE 0 #define GLINE_PENDING_ADD_TYPE 1 #define CLEANUP_GLINES_TIME 300 struct MaskItem; extern void cleanup_glines(void *); extern struct MaskItem *find_is_glined(const char *, const char *); struct gline_pending { dlink_node node; struct { char oper_nick[NICKLEN + 1]; char oper_user[USERLEN + 1]; char oper_host[HOSTLEN + 1]; char oper_server[HOSTLEN + 1]; char reason[REASONLEN + 1]; time_t time_request; } vote_1, vote_2; time_t last_gline_time; /* for expiring entry */ char user[USERLEN * 2 + 2]; char host[HOSTLEN * 2 + 2]; }; extern dlink_list pending_glines[]; #endif /* INCLUDED_s_gline_h */ ircd-hybrid-8.1.13.dfsg.1/include/send.h0000644000175000017500000000737112263053413015741 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * send.h: A header for the message sending functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: send.h 2564 2013-11-17 18:20:52Z michael $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h #include "fdlist.h" #define ALL_MEMBERS 0 #define NON_CHANOPS 1 #define ONLY_CHANOPS_VOICED 2 #define ONLY_CHANOPS 3 #define ONLY_SERVERS 4 /* for channel_mode.c */ #define L_ALL 0 #define L_OPER 1 #define L_ADMIN 2 #define SEND_NOTICE 1 #define SEND_GLOBAL 2 #define SEND_LOCOPS 3 #define NOCAPS 0 /* no caps */ #define NOFLAGS 0 /* no flags */ /* used when sending to #mask or $mask */ #define MATCH_SERVER 1 #define MATCH_HOST 2 /* * struct decls */ struct Channel; struct Client; /* send.c prototypes */ extern void sendq_unblocked(fde_t *, struct Client *); extern void send_queued_write(struct Client *); extern void send_queued_all(void); extern void sendto_one(struct Client *, const char *, ...) AFP(2,3); extern void sendto_channel_butone(struct Client *, struct Client *, struct Channel *, unsigned int, const char *, ...) AFP(5,6); extern void sendto_common_channels_local(struct Client *, int, unsigned int, const char *, ...) AFP(4,5); extern void sendto_channel_local(unsigned int, int, struct Channel *, const char *, ...) AFP(4,5); extern void sendto_channel_local_butone(struct Client *, unsigned int, unsigned int, struct Channel *, const char *, ...) AFP(5,6); extern void sendto_channel_remote(struct Client *, struct Client *, unsigned int, const unsigned int, const unsigned int, struct Channel *, const char *, ...) AFP(7,8); extern void sendto_server(struct Client *, const unsigned int, const unsigned int, const char *, ...) AFP(4,5); extern void sendto_match_butone(struct Client *, struct Client *, char *, int, const char *, ...) AFP(5,6); extern void sendto_match_servs(struct Client *, const char *, unsigned int, const char *, ...) AFP(4,5); extern void sendto_realops_flags(unsigned int, int, int, const char *, ...) AFP(4,5); extern void sendto_wallops_flags(unsigned int, struct Client *, const char *, ...) AFP(3,4); extern void ts_warn(const char *, ...) AFP(1,2); extern void sendto_anywhere(struct Client *, struct Client *, const char *, ...) AFP(3,4); extern void kill_client(struct Client *, struct Client *, const char *, ... ) AFP(3,4); extern void kill_client_serv_butone(struct Client *, struct Client *, const char *, ...) AFP(3,4); #endif /* INCLUDED_send_h */ ircd-hybrid-8.1.13.dfsg.1/include/channel_mode.h0000644000175000017500000000720312263053413017416 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * channel_mode.h: The ircd channel mode header. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: channel_mode.h 1956 2013-05-06 18:59:00Z michael $ */ #ifndef INCLUDED_channel_mode_h #define INCLUDED_channel_mode_h #include "ircd_defs.h" /* buffer sizes */ #define MODEBUFLEN 200 /* Maximum mode changes allowed per client, per server is different */ #define MAXMODEPARAMS 4 /* can_send results */ #define CAN_SEND_NO 0 #define CAN_SEND_NONOP -1 #define CAN_SEND_OPV -2 /* Channel related flags */ #define CHFL_CHANOP 0x0001 /* Channel operator */ #define CHFL_HALFOP 0x0002 /* Channel half op */ #define CHFL_VOICE 0x0004 /* the power to speak */ #define CHFL_DEOPPED 0x0008 /* deopped by us, modes need to be bounced */ #define CHFL_BAN 0x0010 /* ban channel flag */ #define CHFL_EXCEPTION 0x0020 /* exception to ban channel flag */ #define CHFL_INVEX 0x0040 /* channel modes ONLY */ #define MODE_PRIVATE 0x0001 #define MODE_SECRET 0x0002 #define MODE_MODERATED 0x0004 #define MODE_TOPICLIMIT 0x0008 #define MODE_INVITEONLY 0x0010 #define MODE_NOPRIVMSGS 0x0020 #define MODE_SSLONLY 0x0040 #define MODE_OPERONLY 0x0080 #define MODE_REGISTERED 0x0100 /* Channel has been registered with ChanServ */ #define MODE_REGONLY 0x0200 #define MODE_NOCTRL 0x0400 #define MODE_MODREG 0x0800 /* cache flags for silence on ban */ #define CHFL_BAN_CHECKED 0x0080 #define CHFL_BAN_SILENCED 0x0100 #define MODE_QUERY 0 #define MODE_ADD 1 #define MODE_DEL -1 #define CHACCESS_NOTONCHAN -1 #define CHACCESS_PEON 0 #define CHACCESS_HALFOP 1 #define CHACCESS_CHANOP 2 /* name invisible */ #define SecretChannel(x) (((x)->mode.mode & MODE_SECRET)) #define PubChannel(x) (!SecretChannel(x)) /* knock is forbidden, halfops can't kick/deop other halfops. * +pi means paranoid and will generate notices on each invite */ #define PrivateChannel(x) (((x)->mode.mode & MODE_PRIVATE)) struct ChModeChange { char letter; const char *arg; const char *id; int dir; unsigned int caps; unsigned int nocaps; int mems; struct Client *client; }; struct ChCapCombo { int count; unsigned int cap_yes; unsigned int cap_no; }; struct mode_letter { const unsigned int mode; const unsigned char letter; }; extern const struct mode_letter chan_modes[]; extern int add_id(struct Client *, struct Channel *, char *, int); extern void set_channel_mode(struct Client *, struct Client *, struct Channel *, struct Membership *, int, char **, char *); extern void clear_ban_cache(struct Channel *); extern void clear_ban_cache_client(struct Client *); extern void init_chcap_usage_counts(void); extern void set_chcap_usage_counts(struct Client *); extern void unset_chcap_usage_counts(struct Client *); #endif /* INCLUDED_channel_mode_h */ ircd-hybrid-8.1.13.dfsg.1/include/resv.h0000644000175000017500000000237012263053413015761 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * resv.h: A header for the RESV functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: resv.h 2173 2013-06-03 19:40:02Z michael $ */ #ifndef INCLUDED_resv_h #define INCLUDED_resv_h extern struct MaskItem *create_resv(const char *, const char *, const dlink_list *); extern int resv_find_exempt(const struct Client *, const struct MaskItem *); extern struct MaskItem *match_find_resv(const char *); #endif /* INCLUDED_resv_h */ ircd-hybrid-8.1.13.dfsg.1/include/hash.h0000644000175000017500000000431312263053413015724 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * hash.h: A header for the ircd hashtable code. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hash.h 1826 2013-04-15 09:09:09Z michael $ */ #ifndef INCLUDED_hash_h #define INCLUDED_hash_h #define FNV1_32_INIT 0x811c9dc5 #define FNV1_32_BITS 16 #define FNV1_32_SIZE (1 << FNV1_32_BITS) /* 2^16 = 65536 */ #define HASHSIZE FNV1_32_SIZE struct Client; struct Channel; struct UserHost; enum { HASH_TYPE_ID, HASH_TYPE_CLIENT, HASH_TYPE_CHANNEL, HASH_TYPE_USERHOST }; extern void hash_init(void); extern void hash_add_client(struct Client *); extern void hash_del_client(struct Client *); extern void hash_add_channel(struct Channel *); extern void hash_del_channel(struct Channel *); extern void hash_add_id(struct Client *); extern void hash_del_id(struct Client *); extern void hash_add_userhost(struct UserHost *); extern void hash_del_userhost(struct UserHost *); extern struct UserHost *hash_find_userhost(const char *); extern struct Client *hash_find_id(const char *); extern struct Client *hash_find_client(const char *); extern struct Client *hash_find_server(const char *); extern struct Channel *hash_find_channel(const char *); extern void *hash_get_bucket(int, unsigned int); extern void free_list_task(struct ListTask *, struct Client *); extern void safe_list_channels(struct Client *, struct ListTask *, int); extern unsigned int strhash(const char *); #endif /* INCLUDED_hash_h */ ircd-hybrid-8.1.13.dfsg.1/include/hook.h0000644000175000017500000000321112263053413015735 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * hook.h: A header for the hooks into parts of ircd. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hook.h 1149 2011-07-31 20:04:17Z michael $ */ #ifndef __HOOK_H_INCLUDED #define __HOOK_H_INCLUDED #define HOOK_V2 typedef void *CBFUNC(va_list); struct Callback { char *name; dlink_list chain; dlink_node node; unsigned int called; time_t last; }; struct Client; extern struct Callback *register_callback(const char *, CBFUNC *); extern void *execute_callback(struct Callback *, ...); extern struct Callback *find_callback(const char *); extern dlink_node *install_hook(struct Callback *, CBFUNC *); extern void uninstall_hook(struct Callback *, CBFUNC *); extern void *pass_callback(dlink_node *, ...); extern void stats_hooks(struct Client *); #define is_callback_present(c) (!!dlink_list_length(&c->chain)) #endif ircd-hybrid-8.1.13.dfsg.1/include/s_bsd.h0000644000175000017500000000462112263053413016075 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd.h: A header for the network subsystem. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd.h 2631 2013-12-08 18:33:35Z michael $ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h #include "config.h" #include "fdlist.h" /* Type of IO */ #define COMM_SELECT_READ 1 #define COMM_SELECT_WRITE 2 /* How long can comm_select() wait for network events [milliseconds] */ #define SELECT_DELAY 500 struct Client; struct MaskItem; struct Listener; extern void add_connection(struct Listener *, struct irc_ssaddr *, int); extern void close_connection(struct Client *); extern void report_error(int, const char *, const char *, int); extern int get_sockerr(int); extern int ignoreErrno(int); extern void comm_settimeout(fde_t *, time_t, PF *, void *); extern void comm_setflush(fde_t *, time_t, PF *, void *); extern void comm_checktimeouts(void *); extern void comm_connect_tcp(fde_t *, const char *, u_short, struct sockaddr *, int, CNCB *, void *, int, int); extern const char * comm_errstr(int status); extern int comm_open(fde_t *F, int family, int sock_type, int proto, const char *note); extern int comm_accept(struct Listener *, struct irc_ssaddr *pn); /* These must be defined in the network IO loop code of your choice */ extern void init_netio(void); extern void comm_setselect(fde_t *, unsigned int, PF *, void *, time_t); extern int read_message (time_t, unsigned char); extern void comm_select(void); extern void check_can_use_v6(void); #ifdef IPV6 extern void remove_ipv6_mapping(struct irc_ssaddr *); #endif #endif /* INCLUDED_s_bsd_h */ ircd-hybrid-8.1.13.dfsg.1/include/event.h0000644000175000017500000000327512263053413016130 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * event.h: The ircd event header. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: event.h 1654 2012-11-16 19:39:37Z michael $ */ #ifndef INCLUDED_event_h #define INCLUDED_event_h #include "client.h" /* * How many event entries we need to allocate at a time in the block * allocator. 16 should be plenty at a time. */ #define MAX_EVENTS 50 typedef void EVH(void *); /* The list of event processes */ struct ev_entry { EVH *func; void *arg; const char *name; time_t frequency; time_t when; int active; }; extern void eventAdd(const char *, EVH *, void *, time_t); extern void eventAddIsh(const char *, EVH *, void *, time_t); extern void eventRun(void); extern time_t eventNextTime(void); extern void eventInit(void); extern void eventDelete(EVH *, void *); extern void set_back_events(time_t); extern void show_events(struct Client *); #endif /* INCLUDED_event_h */ ircd-hybrid-8.1.13.dfsg.1/include/ircd.h0000644000175000017500000000757312263053413015735 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd.h: A header for the ircd startup routines. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd.h 1858 2013-04-25 15:00:52Z michael $ */ #ifndef INCLUDED_ircd_h #define INCLUDED_ircd_h #include "ircd_defs.h" #include "config.h" struct SetOptions { int autoconn; /* autoconn enabled for all servers? */ int floodcount; /* Number of messages in 1 second */ int joinfloodtime; int joinfloodcount; int ident_timeout; /* timeout for identd lookups */ int spam_num; int spam_time; }; /* * statistics structures */ struct ServerStatistics { uint64_t is_cbs; /* bytes sent to clients */ uint64_t is_cbr; /* bytes received from clients */ uint64_t is_sbs; /* bytes sent to servers */ uint64_t is_sbr; /* bytes received from servers */ time_t is_cti; /* time spent connected by clients */ time_t is_sti; /* time spent connected by servers */ unsigned int is_cl; /* number of client connections */ unsigned int is_sv; /* number of server connections */ unsigned int is_ni; /* connection but no idea who it was */ unsigned int is_ac; /* connections accepted */ unsigned int is_ref; /* accepts refused */ unsigned int is_unco; /* unknown commands */ unsigned int is_wrdi; /* command going in wrong direction */ unsigned int is_unpf; /* unknown prefix */ unsigned int is_empt; /* empty message */ unsigned int is_num; /* numeric message */ unsigned int is_kill; /* number of kills generated on collisions */ unsigned int is_asuc; /* successful auth requests */ unsigned int is_abad; /* bad auth requests */ }; struct Counter { uint64_t totalrestartcount; /* Total client count ever */ unsigned int myserver; /* my servers */ unsigned int oper; /* Opers */ unsigned int local; /* Local Clients */ unsigned int total; /* total clients */ unsigned int invisi; /* invisible clients */ unsigned int max_loc; /* MAX local clients */ unsigned int max_tot; /* MAX global clients */ unsigned int max_loc_con; /* MAX local connection count (clients + server) */ unsigned int max_loc_cli; /* XXX This is redundant - Max local client count */ }; struct ServerState_t { int foreground; }; #ifdef HAVE_LIBGEOIP extern GeoIP *geoip_ctx; #endif extern char **myargv; extern const char *infotext[]; extern const char *serno; extern const char *ircd_version; extern const char *logFileName; extern const char *pidFileName; extern int dorehash; extern int doremotd; extern struct Counter Count; extern struct ServerStatistics ServerStats; extern struct SetOptions GlobalSetOptions; /* defined in ircd.c */ extern struct ServerState_t server_state; extern struct timeval SystemTime; #define CurrentTime SystemTime.tv_sec extern int default_server_capabs; extern unsigned int splitmode; extern unsigned int splitchecking; extern unsigned int split_users; extern unsigned int split_servers; extern int rehashed_klines; extern void set_time(void); #endif ircd-hybrid-8.1.13.dfsg.1/include/numeric.h0000644000175000017500000002115412263053413016445 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * numeric.h: A header for the numeric functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: numeric.h 2726 2013-12-29 13:27:10Z michael $ */ #ifndef INCLUDED_numeric_h #define INCLUDED_numeric_h /* form_str - return a format string for a message number * messages are defined below */ extern const char *form_str(unsigned int); /* * Reserve numerics 000-099 for server-client connections where the client * is local to the server. If any server is passed a numeric in this range * from another server then it is remapped to 100-199. -avalon */ #define RPL_WELCOME 001 #define RPL_YOURHOST 002 #define RPL_CREATED 003 #define RPL_MYINFO 004 #define RPL_ISUPPORT 005 #define RPL_REDIR 10 #define RPL_MAP 15 /* Undernet extension */ #define RPL_MAPMORE 16 /* Undernet extension */ #define RPL_MAPEND 17 /* Undernet extension */ #define RPL_YOURID 42 /* IRCnet extension */ /* * Numeric replies from server commands. * These are currently in the range 200-399. */ #define RPL_TRACELINK 200 #define RPL_TRACECONNECTING 201 #define RPL_TRACEHANDSHAKE 202 #define RPL_TRACEUNKNOWN 203 #define RPL_TRACEOPERATOR 204 #define RPL_TRACEUSER 205 #define RPL_TRACESERVER 206 #define RPL_TRACENEWTYPE 208 #define RPL_TRACECLASS 209 #define RPL_STATSLINKINFO 211 #define RPL_STATSCOMMANDS 212 #define RPL_STATSCLINE 213 #define RPL_STATSNLINE 214 #define RPL_STATSILINE 215 #define RPL_STATSKLINE 216 #define RPL_STATSQLINE 217 #define RPL_STATSYLINE 218 #define RPL_ENDOFSTATS 219 /* * note ircu uses 217 for STATSPLINE frip. conflict * as RPL_STATSQLINE was used in old 2.8 for Q line * I'm going to steal 220 for now *sigh* * -Dianora */ #define RPL_STATSPLINE 220 #define RPL_UMODEIS 221 #define RPL_STATSFLINE 224 #define RPL_STATSDLINE 225 #define RPL_STATSALINE 226 #define RPL_STATSLLINE 241 #define RPL_STATSUPTIME 242 #define RPL_STATSOLINE 243 #define RPL_STATSHLINE 244 #define RPL_STATSTLINE 245 #define RPL_STATSSERVICE 246 #define RPL_STATSXLINE 247 #define RPL_STATSULINE 248 #define RPL_STATSDEBUG 249 #define RPL_STATSCONN 250 #define RPL_LUSERCLIENT 251 #define RPL_LUSEROP 252 #define RPL_LUSERUNKNOWN 253 #define RPL_LUSERCHANNELS 254 #define RPL_LUSERME 255 #define RPL_ADMINME 256 #define RPL_ADMINLOC1 257 #define RPL_ADMINLOC2 258 #define RPL_ADMINEMAIL 259 #define RPL_ENDOFTRACE 262 #define RPL_LOAD2HI 263 #define RPL_LOCALUSERS 265 #define RPL_GLOBALUSERS 266 #define RPL_WHOISCERTFP 276 #define RPL_ACCEPTLIST 281 #define RPL_ENDOFACCEPT 282 #define RPL_NEWHOSTIS 285 /* numeric_replies */ #define RPL_AWAY 301 #define RPL_USERHOST 302 #define RPL_ISON 303 #define RPL_UNAWAY 305 #define RPL_NOWAWAY 306 #define RPL_WHOISREGNICK 307 #define RPL_WHOISUSER 311 #define RPL_WHOISSERVER 312 #define RPL_WHOISOPERATOR 313 #define RPL_WHOWASUSER 314 #define RPL_ENDOFWHO 315 #define RPL_WHOISCHANOP 316 /* redundant and not needed but reserved */ #define RPL_WHOISIDLE 317 #define RPL_ENDOFWHOIS 318 #define RPL_WHOISCHANNELS 319 #define RPL_LISTSTART 321 #define RPL_LIST 322 #define RPL_LISTEND 323 #define RPL_CHANNELMODEIS 324 #define RPL_CREATIONTIME 329 #define RPL_WHOISACCOUNT 330 #define RPL_NOTOPIC 331 #define RPL_TOPIC 332 #define RPL_TOPICWHOTIME 333 #define RPL_WHOISTEXT 337 #define RPL_WHOISACTUALLY 338 #define RPL_INVITING 341 #define RPL_INVITELIST 346 #define RPL_ENDOFINVITELIST 347 #define RPL_EXCEPTLIST 348 #define RPL_ENDOFEXCEPTLIST 349 #define RPL_VERSION 351 #define RPL_WHOREPLY 352 #define RPL_NAMREPLY 353 #define RPL_CLOSING 362 #define RPL_CLOSEEND 363 #define RPL_LINKS 364 #define RPL_ENDOFLINKS 365 #define RPL_ENDOFNAMES 366 #define RPL_BANLIST 367 #define RPL_ENDOFBANLIST 368 #define RPL_ENDOFWHOWAS 369 #define RPL_INFO 371 #define RPL_MOTD 372 #define RPL_INFOSTART 373 #define RPL_ENDOFINFO 374 #define RPL_MOTDSTART 375 #define RPL_ENDOFMOTD 376 #define RPL_WHOISMODES 379 #define RPL_YOUREOPER 381 #define RPL_REHASHING 382 #define RPL_RSACHALLENGE 386 #define RPL_TIME 391 #define RPL_USERSSTART 392 #define RPL_USERS 393 #define RPL_ENDOFUSERS 394 #define RPL_NOUSERS 395 #define RPL_HOSTHIDDEN 396 /* * Errors are in the range from 400-599 currently and are grouped by what * commands they come from. */ #define ERR_NOSUCHNICK 401 #define ERR_NOSUCHSERVER 402 #define ERR_NOSUCHCHANNEL 403 #define ERR_CANNOTSENDTOCHAN 404 #define ERR_TOOMANYCHANNELS 405 #define ERR_WASNOSUCHNICK 406 #define ERR_TOOMANYTARGETS 407 #define ERR_NOCTRLSONCHAN 408 #define ERR_NOORIGIN 409 #define ERR_INVALIDCAPCMD 410 #define ERR_NORECIPIENT 411 #define ERR_NOTEXTTOSEND 412 #define ERR_NOTOPLEVEL 413 #define ERR_WILDTOPLEVEL 414 #define ERR_UNKNOWNCOMMAND 421 #define ERR_NOMOTD 422 #define ERR_NOADMININFO 423 #define ERR_NONICKNAMEGIVEN 431 #define ERR_ERRONEUSNICKNAME 432 #define ERR_NICKNAMEINUSE 433 #define ERR_NICKCOLLISION 436 #define ERR_UNAVAILRESOURCE 437 #define ERR_NICKTOOFAST 438 /* We did it first Undernet! ;) db */ #define ERR_SERVICESDOWN 440 #define ERR_USERNOTINCHANNEL 441 #define ERR_NOTONCHANNEL 442 #define ERR_USERONCHANNEL 443 #define ERR_NOTREGISTERED 451 #define ERR_ACCEPTFULL 456 #define ERR_ACCEPTEXIST 457 #define ERR_ACCEPTNOT 458 #define ERR_NEEDMOREPARAMS 461 #define ERR_ALREADYREGISTRED 462 #define ERR_PASSWDMISMATCH 464 #define ERR_YOUREBANNEDCREEP 465 #define ERR_ONLYSERVERSCANCHANGE 468 #define ERR_OPERONLYCHAN 470 #define ERR_CHANNELISFULL 471 #define ERR_UNKNOWNMODE 472 #define ERR_INVITEONLYCHAN 473 #define ERR_BANNEDFROMCHAN 474 #define ERR_BADCHANNELKEY 475 #define ERR_NEEDREGGEDNICK 477 #define ERR_BANLISTFULL 478 /* I stole the numeric from ircu -db */ #define ERR_BADCHANNAME 479 #define ERR_SSLONLYCHAN 480 #define ERR_NOPRIVILEGES 481 #define ERR_CHANOPRIVSNEEDED 482 #define ERR_CANTKILLSERVER 483 #define ERR_RESTRICTED 484 #define ERR_CHANBANREASON 485 #define ERR_NONONREG 486 #define ERR_NOOPERHOST 491 #define ERR_UMODEUNKNOWNFLAG 501 #define ERR_USERSDONTMATCH 502 #define ERR_GHOSTEDCLIENT 503 #define ERR_USERNOTONSERV 504 #define ERR_TOOMANYWATCH 512 #define ERR_WRONGPONG 513 #define ERR_LONGMASK 518 /* Undernet extension -Kev */ #define ERR_LISTSYNTAX 521 #define ERR_HELPNOTFOUND 524 #define RPL_LOGON 600 #define RPL_LOGOFF 601 #define RPL_WATCHOFF 602 #define RPL_WATCHSTAT 603 #define RPL_NOWON 604 #define RPL_NOWOFF 605 #define RPL_WATCHLIST 606 #define RPL_ENDOFWATCHLIST 607 #define RPL_WHOISSECURE 671 #define RPL_MODLIST 702 #define RPL_ENDOFMODLIST 703 #define RPL_HELPSTART 704 #define RPL_HELPTXT 705 #define RPL_ENDOFHELP 706 #define RPL_ETRACE 709 #define RPL_KNOCK 710 #define RPL_KNOCKDLVR 711 #define ERR_TOOMANYKNOCK 712 #define ERR_CHANOPEN 713 #define ERR_KNOCKONCHAN 714 #define RPL_TARGUMODEG 716 #define RPL_TARGNOTIFY 717 #define RPL_UMODEGMSG 718 #define ERR_NOPRIVS 723 #define ERR_LAST_ERR_MSG 999 #endif /* INCLUDED_numeric_h */ ircd-hybrid-8.1.13.dfsg.1/include/log.h0000644000175000017500000000271412263053413015565 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * log.h: A header for the logger functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: log.h 2337 2013-07-03 13:00:46Z michael $ */ #ifndef INCLUDED_s_log_h #define INCLUDED_s_log_h #define LOG_BUFSIZE 1024 enum log_type { LOG_TYPE_IRCD, LOG_TYPE_KILL, LOG_TYPE_KLINE, LOG_TYPE_DLINE, LOG_TYPE_GLINE, LOG_TYPE_XLINE, LOG_TYPE_RESV, LOG_TYPE_OPER, LOG_TYPE_USER, LOG_TYPE_DEBUG, LOG_TYPE_LAST }; extern void log_set_file(enum log_type, size_t, const char *); extern void log_del_all(void); extern void log_reopen_all(void); extern void ilog(enum log_type, const char *, ...) AFP(2,3); #endif /* INCLUDED_s_log_h */ ircd-hybrid-8.1.13.dfsg.1/include/client.h0000644000175000017500000005244212263053413016265 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file client.h * \brief Header including structures, macros and prototypes for client handling * \version $Id: client.h 2590 2013-11-21 13:51:37Z michael $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h #include "list.h" #include "fdlist.h" #include "config.h" #include "ircd_defs.h" #include "dbuf.h" #include "channel.h" #include "s_auth.h" /* * status macros. */ #define STAT_CONNECTING 0x01 #define STAT_HANDSHAKE 0x02 #define STAT_ME 0x04 #define STAT_UNKNOWN 0x08 #define STAT_SERVER 0x10 #define STAT_CLIENT 0x20 #define REG_NEED_USER 0x1 #define REG_NEED_NICK 0x2 #define REG_NEED_CAP 0x4 #define REG_INIT (REG_NEED_USER|REG_NEED_NICK) #define HasID(x) ((x)->id[0] != '\0') #define ID(x) (HasID(x) ? (x)->id : (x)->name) #define ID_or_name(x,client_p) ((IsCapable(client_p->from, CAP_TS6) && HasID(x)) ? (x)->id : (x)->name) #define IsRegistered(x) ((x)->status > STAT_UNKNOWN) #define IsConnecting(x) ((x)->status == STAT_CONNECTING) #define IsHandshake(x) ((x)->status == STAT_HANDSHAKE) #define IsMe(x) ((x)->status == STAT_ME) #define IsUnknown(x) ((x)->status == STAT_UNKNOWN) #define IsServer(x) ((x)->status == STAT_SERVER) #define IsClient(x) ((x)->status == STAT_CLIENT) #define SetConnecting(x) {(x)->status = STAT_CONNECTING; \ (x)->handler = UNREGISTERED_HANDLER; } #define SetHandshake(x) {(x)->status = STAT_HANDSHAKE; \ (x)->handler = UNREGISTERED_HANDLER; } #define SetMe(x) {(x)->status = STAT_ME; \ (x)->handler = UNREGISTERED_HANDLER; } #define SetUnknown(x) {(x)->status = STAT_UNKNOWN; \ (x)->handler = UNREGISTERED_HANDLER; } #define SetServer(x) {(x)->status = STAT_SERVER; \ (x)->handler = SERVER_HANDLER; } #define SetClient(x) {(x)->status = STAT_CLIENT; \ (x)->handler = HasUMode(x, UMODE_OPER) ? \ OPER_HANDLER : CLIENT_HANDLER; } #define MyConnect(x) ((x)->localClient != NULL) #define MyClient(x) (MyConnect(x) && IsClient(x)) /* * ts stuff */ #define TS_CURRENT 6 /**< current TS protocol version */ #define TS_MIN 5 /**< minimum supported TS protocol version */ #define TS_DOESTS 0x20000000 #define DoesTS(x) ((x)->tsinfo == TS_DOESTS) #define CAP_MULTI_PREFIX 0x00000001 #define CAP_AWAY_NOTIFY 0x00000002 #define HasCap(x, y) ((x)->localClient->cap_active & (y)) /* housekeeping flags */ #define FLAGS_PINGSENT 0x00000001 /**< Unreplied ping sent */ #define FLAGS_DEADSOCKET 0x00000002 /**< Local socket is dead--Exiting soon */ #define FLAGS_KILLED 0x00000004 /**< Prevents "QUIT" from being sent for this */ #define FLAGS_CLOSING 0x00000008 /**< set when closing to suppress errors */ #define FLAGS_GOTID 0x00000010 /**< successful ident lookup achieved */ #define FLAGS_NEEDID 0x00000020 /**< auth{} block say must use ident return */ #define FLAGS_SENDQEX 0x00000040 /**< Sendq exceeded */ #define FLAGS_IPHASH 0x00000080 /**< iphashed this client */ #define FLAGS_MARK 0x00000100 /**< marked client */ #define FLAGS_CANFLOOD 0x00000200 /**< client has the ability to flood */ #define FLAGS_EXEMPTGLINE 0x00000400 /**< client can't be G-lined */ #define FLAGS_EXEMPTKLINE 0x00000800 /**< client is exempt from kline */ #define FLAGS_NOLIMIT 0x00001000 /**< client is exempt from limits */ #define FLAGS_PING_COOKIE 0x00002000 /**< PING Cookie */ #define FLAGS_IP_SPOOFING 0x00004000 /**< client IP is spoofed */ #define FLAGS_FLOODDONE 0x00008000 /**< Flood grace period has been ended. */ #define FLAGS_EOB 0x00010000 /**< server has sent us an EOB */ #define FLAGS_HIDDEN 0x00020000 /**< a hidden server. not shown in /links */ #define FLAGS_BLOCKED 0x00040000 /**< must wait for COMM_SELECT_WRITE */ #define FLAGS_USERHOST 0x00080000 /**< client is in userhost hash */ #define FLAGS_BURSTED 0x00100000 /**< user was already bursted */ #define FLAGS_EXEMPTRESV 0x00200000 /**< client is exempt from RESV */ #define FLAGS_GOTUSER 0x00400000 /**< if we received a USER command */ #define FLAGS_FINISHED_AUTH 0x00800000 /**< Client has been released from auth */ #define FLAGS_FLOOD_NOTICED 0x01000000 /**< Notice to opers about this flooder has been sent */ #define FLAGS_SERVICE 0x02000000 /**< Client/server is a network service */ #define FLAGS_AUTH_SPOOF 0x04000000 /**< user's hostname has been spoofed by an auth{} spoof*/ #define FLAGS_SSL 0x08000000 /**< User is connected via TLS/SSL */ #define HasFlag(x, y) ((x)->flags & (y)) #define AddFlag(x, y) ((x)->flags |= (y)) #define DelFlag(x, y) ((x)->flags &= ~(y)) /* umodes, settable flags */ #define UMODE_SERVNOTICE 0x00000001 /**< server notices such as kill */ #define UMODE_CCONN 0x00000002 /**< Client Connections */ #define UMODE_REJ 0x00000004 /**< Bot Rejections */ #define UMODE_SKILL 0x00000008 /**< Server Killed */ #define UMODE_FULL 0x00000010 /**< Full messages */ #define UMODE_SPY 0x00000020 /**< see STATS / LINKS */ #define UMODE_DEBUG 0x00000040 /**< 'debugging' info */ #define UMODE_NCHANGE 0x00000080 /**< Nick change notice */ #define UMODE_WALLOP 0x00000100 /**< send wallops to them */ #define UMODE_OPERWALL 0x00000200 /**< Operwalls */ #define UMODE_INVISIBLE 0x00000400 /**< makes user invisible */ #define UMODE_BOTS 0x00000800 /**< shows bots */ #define UMODE_EXTERNAL 0x00001000 /**< show servers introduced and splitting */ #define UMODE_CALLERID 0x00002000 /**< block unless caller id's */ #define UMODE_SOFTCALLERID 0x00004000 /**< block unless on common channel */ #define UMODE_UNAUTH 0x00008000 /**< show unauth connects here */ #define UMODE_LOCOPS 0x00010000 /**< show locops */ #define UMODE_DEAF 0x00020000 /**< don't receive channel messages */ #define UMODE_REGISTERED 0x00040000 /**< User has identified for that nick. */ #define UMODE_REGONLY 0x00080000 /**< Only registered nicks may PM */ #define UMODE_HIDDEN 0x00100000 /**< Operator status is hidden */ #define UMODE_OPER 0x00200000 /**< Operator */ #define UMODE_ADMIN 0x00400000 /**< Admin on server */ #define UMODE_FARCONNECT 0x00800000 /**< Can see remote client connects/exits */ #define UMODE_HIDDENHOST 0x01000000 /**< User's host is hidden */ #define UMODE_SSL 0x02000000 /**< User is connected via TLS/SSL */ #define UMODE_WEBIRC 0x04000000 /**< User connected via a webirc gateway */ #define UMODE_ALL UMODE_SERVNOTICE #define HasUMode(x, y) ((x)->umodes & (y)) #define AddUMode(x, y) ((x)->umodes |= (y)) #define DelUMode(x, y) ((x)->umodes &= ~(y)) #define SEND_UMODES (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP |\ UMODE_REGONLY | UMODE_REGISTERED | UMODE_ADMIN |\ UMODE_HIDDEN | UMODE_HIDDENHOST | UMODE_SSL |\ UMODE_WEBIRC | UMODE_CALLERID | UMODE_SOFTCALLERID) /* oper priv flags */ #define OPER_FLAG_KILL_REMOTE 0x00000001 /**< Oper can global kill */ #define OPER_FLAG_KILL 0x00000002 /**< Oper can do local KILL */ #define OPER_FLAG_UNKLINE 0x00000004 /**< Oper can use unkline */ #define OPER_FLAG_GLINE 0x00000008 /**< Oper can use gline */ #define OPER_FLAG_K 0x00000010 /**< Oper can kill/kline */ #define OPER_FLAG_X 0x00000020 /**< Oper can xline */ #define OPER_FLAG_DIE 0x00000040 /**< Oper can die */ #define OPER_FLAG_REHASH 0x00000080 /**< Oper can rehash */ #define OPER_FLAG_ADMIN 0x00000100 /**< Oper can set umode +a */ #define OPER_FLAG_OPERWALL 0x00000200 /**< Oper can use OPERWALL command */ #define OPER_FLAG_REMOTEBAN 0x00000400 /**< Oper can set remote bans */ #define OPER_FLAG_GLOBOPS 0x00000800 /**< Oper can use GLOBOPS command */ #define OPER_FLAG_MODULE 0x00001000 /**< Oper can use MODULE commands */ #define OPER_FLAG_RESTART 0x00002000 /**< Oper can use RESTART command */ #define OPER_FLAG_DLINE 0x00004000 /**< Oper can use DLINE command */ #define OPER_FLAG_UNDLINE 0x00008000 /**< Oper can use UNDLINE command */ #define OPER_FLAG_SET 0x00010000 /**< Oper can use SET command */ #define OPER_FLAG_SQUIT 0x00020000 /**< Oper can do local SQUIT */ #define OPER_FLAG_SQUIT_REMOTE 0x00040000 /**< Oper can do global SQUIT */ #define OPER_FLAG_CONNECT 0x00080000 /**< Oper can do local CONNECT */ #define OPER_FLAG_CONNECT_REMOTE 0x00100000 /**< Oper can do global CONNECT */ #define OPER_FLAG_WALLOPS 0x00200000 /**< Oper can do WALLOPS */ #define OPER_FLAG_LOCOPS 0x00400000 /**< Oper can do LOCOPS */ #define HasOFlag(x, y) (MyConnect(x) ? (x)->localClient->operflags & (y) : 0) #define AddOFlag(x, y) ((x)->localClient->operflags |= (y)) #define DelOFlag(x, y) ((x)->localClient->operflags &= ~(y)) #define ClrOFlag(x) ((x)->localClient->operflags = 0) /* flags macros. */ #define IsAuthFinished(x) ((x)->flags & FLAGS_FINISHED_AUTH) #define IsDead(x) ((x)->flags & FLAGS_DEADSOCKET) #define SetDead(x) ((x)->flags |= FLAGS_DEADSOCKET) #define IsClosing(x) ((x)->flags & FLAGS_CLOSING) #define SetClosing(x) ((x)->flags |= FLAGS_CLOSING) #define SetCanFlood(x) ((x)->flags |= FLAGS_CANFLOOD) #define IsCanFlood(x) ((x)->flags & FLAGS_CANFLOOD) #define IsDefunct(x) ((x)->flags & (FLAGS_DEADSOCKET|FLAGS_CLOSING| \ FLAGS_KILLED)) /* oper flags */ #define MyOper(x) (MyConnect(x) && HasUMode(x, UMODE_OPER)) #define SetOper(x) {(x)->umodes |= UMODE_OPER; \ if (!IsServer((x))) (x)->handler = OPER_HANDLER;} #define ClearOper(x) {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \ if (!HasUMode(x, UMODE_OPER) && !IsServer((x))) \ (x)->handler = CLIENT_HANDLER; } #define SetSendQExceeded(x) ((x)->flags |= FLAGS_SENDQEX) #define IsSendQExceeded(x) ((x)->flags & FLAGS_SENDQEX) #define SetIpHash(x) ((x)->flags |= FLAGS_IPHASH) #define ClearIpHash(x) ((x)->flags &= ~FLAGS_IPHASH) #define IsIpHash(x) ((x)->flags & FLAGS_IPHASH) #define SetUserHost(x) ((x)->flags |= FLAGS_USERHOST) #define ClearUserHost(x) ((x)->flags &= ~FLAGS_USERHOST) #define IsUserHostIp(x) ((x)->flags & FLAGS_USERHOST) #define SetPingSent(x) ((x)->flags |= FLAGS_PINGSENT) #define IsPingSent(x) ((x)->flags & FLAGS_PINGSENT) #define ClearPingSent(x) ((x)->flags &= ~FLAGS_PINGSENT) #define SetNeedId(x) ((x)->flags |= FLAGS_NEEDID) #define IsNeedId(x) ((x)->flags & FLAGS_NEEDID) #define SetGotId(x) ((x)->flags |= FLAGS_GOTID) #define IsGotId(x) ((x)->flags & FLAGS_GOTID) #define IsExemptKline(x) ((x)->flags & FLAGS_EXEMPTKLINE) #define SetExemptKline(x) ((x)->flags |= FLAGS_EXEMPTKLINE) #define IsExemptLimits(x) ((x)->flags & FLAGS_NOLIMIT) #define SetExemptLimits(x) ((x)->flags |= FLAGS_NOLIMIT) #define IsExemptGline(x) ((x)->flags & FLAGS_EXEMPTGLINE) #define SetExemptGline(x) ((x)->flags |= FLAGS_EXEMPTGLINE) #define IsExemptResv(x) ((x)->flags & FLAGS_EXEMPTRESV) #define SetExemptResv(x) ((x)->flags |= FLAGS_EXEMPTRESV) #define SetIPSpoof(x) ((x)->flags |= FLAGS_IP_SPOOFING) #define IsIPSpoof(x) ((x)->flags & FLAGS_IP_SPOOFING) #define DelIPSpoof(x) ((x)->flags &= ~FLAGS_IP_SPOOFING) #define IsFloodDone(x) ((x)->flags & FLAGS_FLOODDONE) #define SetFloodDone(x) ((x)->flags |= FLAGS_FLOODDONE) #define HasPingCookie(x) ((x)->flags & FLAGS_PING_COOKIE) #define SetPingCookie(x) ((x)->flags |= FLAGS_PING_COOKIE) #define IsHidden(x) ((x)->flags & FLAGS_HIDDEN) #define SetHidden(x) ((x)->flags |= FLAGS_HIDDEN) #define IsSendqBlocked(x) ((x)->flags & FLAGS_BLOCKED) #define SetSendqBlocked(x) ((x)->flags |= FLAGS_BLOCKED) #define ClearSendqBlocked(x) ((x)->flags &= ~FLAGS_BLOCKED) /*! \brief addr_mask_type enumeration */ enum addr_mask_type { HIDE_IP, /**< IP is hidden. Resolved hostname is shown instead */ SHOW_IP, /**< IP is shown. No parts of it are hidden or masked */ MASK_IP /**< IP is masked. 255.255.255.255 is shown instead */ }; /*! \brief Server structure */ struct Server { dlink_list server_list; /**< Servers on this server */ dlink_list client_list; /**< Clients on this server */ char by[NICKLEN + 1]; /**< who activated this connection */ }; /*! \brief ListTask structure */ struct ListTask { dlink_list show_mask; /**< show these channels.. */ dlink_list hide_mask; /**< ..and hide these ones */ unsigned int hash_index; /**< the bucket we are currently in */ unsigned int users_min; unsigned int users_max; unsigned int created_min; unsigned int created_max; unsigned int topicts_min; unsigned int topicts_max; }; /*! \brief LocalUser structure * * Allocated only for local clients, that are directly connected * to \b this server with a socket. */ struct LocalUser { dlink_node lclient_node; unsigned int registration; unsigned int cap_client; /**< Client capabilities (from us) */ unsigned int cap_active; /**< Active capabilities (to us) */ unsigned int caps; /**< capabilities bit-field */ unsigned int operflags; /**< IRC Operator privilege flags */ unsigned int random_ping; /**< Holding a 32bit value used for PING cookies */ unsigned int serial; /**< used to enforce 1 send per nick */ time_t lasttime; /**< ...should be only LOCAL clients? --msa */ time_t firsttime; /**< time client was created */ time_t since; /**< last time we parsed something */ time_t last_knock; /**< time of last knock */ time_t last_join_time; /**< when this client last joined a channel */ time_t last_leave_time; /**< when this client last * left a channel */ int join_leave_count; /**< count of JOIN/LEAVE in less than MIN_JOIN_LEAVE_TIME seconds */ int oper_warn_count_down; /**< warn opers of this possible spambot every time this gets to 0 */ time_t last_caller_id_time; time_t first_received_message_time; time_t last_nick_change; time_t last_privmsg; /**< Last time we got a PRIVMSG */ time_t last_away; /**< Away since... */ int received_number_of_privmsgs; unsigned int number_of_nick_changes; struct ListTask *list_task; struct dbuf_queue buf_sendq; struct dbuf_queue buf_recvq; struct { unsigned int messages; /**< Statistics: protocol messages sent/received */ uint64_t bytes; /**< Statistics: total bytes sent/received */ } recv, send; struct AuthRequest auth; struct Listener *listener; /**< listener accepted from */ dlink_list acceptlist; /**< clients I'll allow to talk to me */ dlink_list watches; /**< chain of Watch pointer blocks */ dlink_list confs; /**< Configuration record associated */ dlink_list invited; /**< chain of invite pointer blocks */ struct irc_ssaddr ip; int aftype; /**< Makes life easier for DNS res in IPV6 */ int country_id; /**< ID corresponding to a ISO 3166 country code */ char *passwd; fde_t fd; /* Anti-flood stuff. We track how many messages were parsed and how * many we were allowed in the current second, and apply a simple * decay to avoid flooding. * -- adrian */ int allow_read; /**< how many we're allowed to read in this second */ int sent_parsed; /**< how many messages we've parsed in this second */ char* response; /**< expected response from client */ char* auth_oper; /**< Operator to become if they supply the response.*/ }; /*! \brief Client structure */ struct Client { dlink_node node; dlink_node lnode; /**< Used for Server->servers/users */ struct LocalUser *localClient; struct Client *hnext; /**< For client hash table lookups by name */ struct Client *idhnext; /**< For SID hash table lookups by sid */ struct Server *serv; /**< ...defined, if this is a server */ struct Client *servptr; /**< Points to server this Client is on */ struct Client *from; /**< == self, if Local Client, *NEVER* NULL! */ time_t tsinfo; /**< TS on the nick, SVINFO on server */ unsigned int flags; /**< client flags */ unsigned int umodes; /**< opers, normal users subset */ unsigned int hopcount; /**< number of servers to this 0 = local */ unsigned int status; /**< Client type */ unsigned int handler; /**< Handler index */ dlink_list whowas; dlink_list channel; /**< chain of channel pointer blocks */ char away[AWAYLEN + 1]; /**< Client's AWAY message. Can be set/unset via AWAY command */ char name[HOSTLEN + 1]; /**< unique name for a client nick or host */ char svid[HOSTLEN + 1]; /**< Services ID. XXX: Going with HOSTLEN for now. NICKLEN might be too small if dealing with timestamps */ char id[IDLEN + 1]; /**< client ID, unique ID per client */ /* * client->username is the username from ident or the USER message, * If the client is idented the USER message is ignored, otherwise * the username part of the USER message is put here prefixed with a * tilde depending on the auth{} block. Once a client has registered, * this field should be considered read-only. */ char username[USERLEN + 1]; /* client's username */ /* * client->host contains the resolved name or ip address * as a string for the user, it may be fiddled with for oper spoofing etc. * once it's changed the *real* address goes away. This should be * considered a read-only field after the client has registered. */ char host[HOSTLEN + 1]; /* client's hostname */ /* * client->info for unix clients will normally contain the info from the * gcos field in /etc/passwd but anything can go here. */ char info[REALLEN + 1]; /* Free form additional client info */ /* * client->sockhost contains the ip address gotten from the socket as a * string, this field should be considered read-only once the connection * has been made. (set in s_bsd.c only) */ char sockhost[HOSTIPLEN + 1]; /* This is the host name from the socket ip address as string */ char *certfp; }; extern struct Client me; extern dlink_list listing_client_list; extern dlink_list global_client_list; extern dlink_list unknown_list; /* unknown clients ON this server only */ extern dlink_list local_client_list; /* local clients only ON this server */ extern dlink_list serv_list; /* local servers to this server ONLY */ extern dlink_list global_serv_list; /* global servers on the network */ extern dlink_list oper_list; /* our opers, duplicated in local_client_list */ extern int accept_message(struct Client *, struct Client *); extern unsigned int idle_time_get(const struct Client *, const struct Client *); extern struct split_nuh_item *find_accept(const char *, const char *, const char *, struct Client *, int (*)(const char *, const char *)); extern void del_accept(struct split_nuh_item *, struct Client *); extern void del_all_accepts(struct Client *); extern void exit_client(struct Client *, struct Client *, const char *); extern void check_conf_klines(void); extern void client_init(void); extern void dead_link_on_write(struct Client *, int); extern void dead_link_on_read(struct Client *, int); extern void exit_aborted_clients(void); extern void free_exited_clients(void); extern struct Client *make_client(struct Client *); extern struct Client *find_chasing(struct Client *, const char *, int *const); extern struct Client *find_person(const struct Client *const, const char *); extern const char *get_client_name(const struct Client *, enum addr_mask_type); #endif /* INCLUDED_client_h */ ircd-hybrid-8.1.13.dfsg.1/include/memory.h0000644000175000017500000000240412263053413016310 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * memory.h: A header for the memory functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: memory.h 1664 2012-11-18 14:33:47Z michael $ */ #ifndef _I_MEMORY_H #define _I_MEMORY_H #include "ircd_defs.h" extern void outofmemory(void); extern void *MyMalloc(size_t); extern void *MyRealloc(void *, size_t); extern void MyFree(void *); extern void *xstrdup(const char *); extern void *xstrndup(const char *, size_t); #endif /* _I_MEMORY_H */ ircd-hybrid-8.1.13.dfsg.1/include/channel.h0000644000175000017500000001125512263053413016414 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file channel.h * \brief Responsible for managing channels, members, bans and topics * \version $Id: channel.h 2295 2013-06-19 11:18:29Z michael $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h #include "ircd_defs.h" /* KEYLEN, CHANNELLEN */ /* channel visible */ #define ShowChannel(v,c) (PubChannel(c) || IsMember((v),(c))) #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0) #define AddMemberFlag(x, y) ((x)->flags |= (y)) #define DelMemberFlag(x, y) ((x)->flags &= ~(y)) #define FLOOD_NOTICED 1 #define JOIN_FLOOD_NOTICED 2 #define SetFloodNoticed(x) ((x)->flags |= FLOOD_NOTICED) #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED) #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED) #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED) #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED) #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED) struct Client; /*! \brief Mode structure for channels */ struct Mode { unsigned int mode; /*!< simple modes */ unsigned int limit; /*!< +l userlimit */ char key[KEYLEN + 1]; /*!< +k key */ }; /*! \brief Channel structure */ struct Channel { dlink_node node; struct Channel *hnextch; struct Mode mode; char topic[TOPICLEN + 1]; char topic_info[USERHOST_REPLYLEN]; time_t channelts; time_t topic_time; time_t last_knock; /*!< don't allow knock to flood */ time_t last_join_time; time_t first_received_message_time; /*!< channel flood control */ unsigned int flags; int received_number_of_privmsgs; dlink_list members; dlink_list invites; dlink_list banlist; dlink_list exceptlist; dlink_list invexlist; float number_joined; char chname[CHANNELLEN + 1]; }; /*! \brief Membership structure */ struct Membership { dlink_node channode; /*!< link to chptr->members */ dlink_node usernode; /*!< link to source_p->channel */ struct Channel *chptr; /*!< Channel pointer */ struct Client *client_p; /*!< Client pointer */ unsigned int flags; /*!< user/channel flags, e.g. CHFL_CHANOP */ }; /*! \brief Ban structure. Used for b/e/I n!u\@h masks */ struct Ban { dlink_node node; char *name; char *user; char *host; char *who; size_t len; time_t when; struct irc_ssaddr addr; int bits; int type; }; extern dlink_list global_channel_list; extern int check_channel_name(const char *, const int); extern int can_send(struct Channel *, struct Client *, struct Membership *, const char *); extern int is_banned(const struct Channel *, const struct Client *); extern int can_join(struct Client *, struct Channel *, const char *); extern int has_member_flags(const struct Membership *, const unsigned int); extern void remove_ban(struct Ban *, dlink_list *); extern void channel_init(void); extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, int); extern void remove_user_from_channel(struct Membership *); extern void channel_member_names(struct Client *, struct Channel *, int); extern void add_invite(struct Channel *, struct Client *); extern void del_invite(struct Channel *, struct Client *); extern void send_channel_modes(struct Client *, struct Channel *); extern void channel_modes(struct Channel *, struct Client *, char *, char *); extern void check_spambot_warning(struct Client *, const char *); extern void check_splitmode(void *); extern void free_channel_list(dlink_list *); extern void destroy_channel(struct Channel *); extern void set_channel_topic(struct Channel *, const char *, const char *, time_t, int); extern const char *get_member_status(const struct Membership *, const int); extern struct Channel *make_channel(const char *); extern struct Membership *find_channel_link(struct Client *, struct Channel *); #endif /* INCLUDED_channel_h */ ircd-hybrid-8.1.13.dfsg.1/include/userhost.h0000644000175000017500000000331412263053413016655 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * userhost.h: A header for global user limits. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: userhost.h 1644 2012-11-06 22:20:16Z michael $ */ #ifndef INCLUDED_userhost_h #define INCLUDED_userhost_h struct NameHost { dlink_node node; /* point to other names on this hostname */ char name[USERLEN + 1]; unsigned int icount; /* number of =local= identd on this name*/ unsigned int gcount; /* global user count on this name */ unsigned int lcount; /* local user count on this name */ }; struct UserHost { dlink_list list; /* list of names on this hostname */ struct UserHost *next; char host[HOSTLEN + 1]; }; extern void count_user_host(const char *, const char *, unsigned int *, unsigned int *, unsigned int *); extern void add_user_host(const char *, const char *, int); extern void delete_user_host(const char *, const char *, int global); #endif /* INCLUDED_userhost_h */ ircd-hybrid-8.1.13.dfsg.1/include/irc_reslib.h0000644000175000017500000000340512263053413017117 0ustar domdom/* * include/irc_reslib.h (C)opyright 1992 Darren Reed. * * $Id: irc_reslib.h 1346 2012-04-09 17:35:40Z michael $ */ #ifndef INCLUDED_ircdreslib_h #define INCLUDED_ircdreslib_h /* * Inline versions of get/put short/long. Pointer is advanced. */ #define IRC_NS_GET16(s, cp) { \ const unsigned char *t_cp = (const unsigned char *)(cp); \ (s) = ((uint16_t)t_cp[0] << 8) \ | ((uint16_t)t_cp[1]) \ ; \ (cp) += NS_INT16SZ; \ } #define IRC_NS_GET32(l, cp) { \ const unsigned char *t_cp = (const unsigned char *)(cp); \ (l) = ((uint32_t)t_cp[0] << 24) \ | ((uint32_t)t_cp[1] << 16) \ | ((uint32_t)t_cp[2] << 8) \ | ((uint32_t)t_cp[3]) \ ; \ (cp) += NS_INT32SZ; \ } #define IRC_NS_PUT16(s, cp) { \ uint16_t t_s = (uint16_t)(s); \ unsigned char *t_cp = (unsigned char *)(cp); \ *t_cp++ = t_s >> 8; \ *t_cp = t_s; \ (cp) += NS_INT16SZ; \ } #define IRC_NS_PUT32(l, cp) { \ uint32_t t_l = (uint32_t)(l); \ unsigned char *t_cp = (unsigned char *)(cp); \ *t_cp++ = t_l >> 24; \ *t_cp++ = t_l >> 16; \ *t_cp++ = t_l >> 8; \ *t_cp = t_l; \ (cp) += NS_INT32SZ; \ } extern struct irc_ssaddr irc_nsaddr_list[]; extern int irc_nscount; extern void irc_res_init(void); extern int irc_dn_expand(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, char *dst, int dstsiz); extern int irc_dn_skipname(const unsigned char *ptr, const unsigned char *eom); extern unsigned int irc_ns_get16(const unsigned char *src); extern unsigned long irc_ns_get32(const unsigned char *src); extern void irc_ns_put16(unsigned int src, unsigned char *dst); extern void irc_ns_put32(unsigned long src, unsigned char *dst); extern int irc_res_mkquery(const char *dname, int class, int type, unsigned char *buf, int buflen); #endif /* INCLUDED_res_h */ ircd-hybrid-8.1.13.dfsg.1/include/mempool.h0000644000175000017500000000716312263053413016457 0ustar domdom/* * Copyright (c) 2007-2012, The Tor Project, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the names of the copyright owners nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*! \file mempool.h * \brief Pooling allocator * \version $Id: mempool.h 1662 2012-11-17 20:11:33Z michael $ */ #ifndef TOR_MEMPOOL_H #define TOR_MEMPOOL_H /** A memory pool is a context in which a large number of fixed-sized * objects can be allocated efficiently. See mempool.c for implementation * details. */ typedef struct mp_pool_t mp_pool_t; extern void mp_pool_init(void); extern void *mp_pool_get(mp_pool_t *); extern void mp_pool_release(void *); extern mp_pool_t *mp_pool_new(size_t, size_t); extern void mp_pool_clean(mp_pool_t *, int, int); extern void mp_pool_destroy(mp_pool_t *); extern void mp_pool_assert_ok(mp_pool_t *); extern void mp_pool_log_status(mp_pool_t *); extern void mp_pool_garbage_collect(void *); #define MEMPOOL_STATS struct mp_pool_t { /** Next pool. A pool is usually linked into the mp_allocated_pools list. */ mp_pool_t *next; /** Doubly-linked list of chunks in which no items have been allocated. * The front of the list is the most recently emptied chunk. */ struct mp_chunk_t *empty_chunks; /** Doubly-linked list of chunks in which some items have been allocated, * but which are not yet full. The front of the list is the chunk that has * most recently been modified. */ struct mp_chunk_t *used_chunks; /** Doubly-linked list of chunks in which no more items can be allocated. * The front of the list is the chunk that has most recently become full. */ struct mp_chunk_t *full_chunks; /** Length of empty_chunks. */ int n_empty_chunks; /** Lowest value of empty_chunks since last call to * mp_pool_clean(-1). */ int min_empty_chunks; /** Size of each chunk (in items). */ int new_chunk_capacity; /** Size to allocate for each item, including overhead and alignment * padding. */ size_t item_alloc_size; #ifdef MEMPOOL_STATS /** Total number of items allocated ever. */ uint64_t total_items_allocated; /** Total number of chunks allocated ever. */ uint64_t total_chunks_allocated; /** Total number of chunks freed ever. */ uint64_t total_chunks_freed; #endif }; #endif ircd-hybrid-8.1.13.dfsg.1/include/list.h0000644000175000017500000000512312263053413015754 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * list.h: A header for the code in list.c. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: list.h 1126 2011-02-20 14:30:12Z michael $ */ #ifndef INCLUDED_list_h #define INCLUDED_list_h /* These macros are basically swiped from the linux kernel * they are simple yet effective */ /* * Walks forward of a list. * pos is your node * head is your list head */ #define DLINK_FOREACH(pos, head) for (pos = (head); pos != NULL; pos = pos->next) /* * Walks forward of a list safely while removing nodes * pos is your node * n is another list head for temporary storage * head is your list head */ #define DLINK_FOREACH_SAFE(pos, n, head) for (pos = (head), n = pos ? pos->next : NULL; pos != NULL; pos = n, n = pos ? pos->next : NULL) #define DLINK_FOREACH_PREV(pos, head) for (pos = (head); pos != NULL; pos = pos->prev) /* Returns the list length */ #define dlink_list_length(list) (list)->length /* * double-linked-list stuff */ typedef struct _dlink_node dlink_node; typedef struct _dlink_list dlink_list; struct _dlink_node { void *data; dlink_node *prev; dlink_node *next; }; struct _dlink_list { dlink_node *head; dlink_node *tail; unsigned int length; }; extern void dlinkAdd(void *, dlink_node *, dlink_list *); extern void dlinkAddBefore(dlink_node *, void *, dlink_node *, dlink_list *); extern void dlinkAddTail(void *, dlink_node *, dlink_list *); extern void dlinkDelete(dlink_node *, dlink_list *); extern void dlinkMoveList(dlink_list *, dlink_list *); extern void dlink_move_node(dlink_node *, dlink_list *, dlink_list *); extern dlink_node *dlinkFind(dlink_list *, void *); extern dlink_node *dlinkFindDelete(dlink_list *, void *); extern void init_dlink_nodes(void); extern void free_dlink_node(dlink_node *); extern dlink_node *make_dlink_node(void); #endif ircd-hybrid-8.1.13.dfsg.1/include/motd.h0000644000175000017500000000675412263053413015757 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2000 Kevin L. Mitchell * Copyright (C) 2013 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file motd.h * \brief Message-of-the-day manipulation implementation. * \version $Id: motd.h 2409 2013-07-19 15:43:53Z michael $ */ #ifndef INCLUDED_motd_h #define INCLUDED_motd_h struct Client; /** Type of MOTD. */ enum MotdType { MOTD_UNIVERSAL, /**< MOTD for all users */ MOTD_HOSTMASK, /**< MOTD selected by hostmask */ MOTD_IPMASKV4, /**< MOTD selected by IP mask */ MOTD_IPMASKV6, /**< MOTD selected by IP mask */ MOTD_CLASS /**< MOTD selected by connection class */ }; /** Entry for a single Message Of The Day (MOTD). */ struct Motd { dlink_node node; /**< Next MOTD in the linked list. */ enum MotdType type; /**< Type of MOTD. */ char *path; /**< Pathname of MOTD file. */ char *hostmask; /**< Hostmask if type==MOTD_HOSTMASK, class name if type==MOTD_CLASS, text IP mask if type==MOTD_IPMASK. */ struct irc_ssaddr address; /**< Address if type==MOTD_IPMASK. */ int addrbits; /**< Number of bits checked in Motd::address. */ unsigned int maxcount; /**< Number of lines for MOTD. */ struct MotdCache *cache; /**< MOTD cache entry. */ }; /** Length of one MOTD line(80 chars + '\\0'). */ #define MOTD_LINESIZE 81 /** Maximum number of lines for MOTD */ #define MOTD_MAXLINES 100 /** Cache entry for the contents of a MOTD file. */ struct MotdCache { dlink_node node; /**< Next MotdCache in list. */ char *path; /**< Pathname of file. */ unsigned int ref; /**< Number of references to this entry. */ unsigned int maxcount; /**< Number of lines allocated for message. */ unsigned int count; /**< Actual number of lines used in message. */ struct tm modtime; /**< Last modification time from file. */ char motd[][MOTD_LINESIZE]; /**< Message body. */ }; /* motd_send sends a MOTD off to a user */ extern void motd_send(struct Client *); /* motd_signon sends a MOTD off to a newly-registered user */ extern void motd_signon(struct Client *); /* motd_recache causes all the MOTD caches to be cleared */ extern void motd_recache(void); /* motd_init initializes the MOTD routines, including reading the * ircd.motd and remote.motd files into cache */ extern void motd_init(void); /* This routine adds a MOTD */ extern void motd_add(const char *, const char *); /* This routine clears the list of MOTDs */ extern void motd_clear(void); /* This is called to report T-lines */ extern void motd_report(struct Client *); extern void motd_memory_count(struct Client *); #endif ircd-hybrid-8.1.13.dfsg.1/include/rsa.h0000644000175000017500000000233312263053413015566 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * rsa.h: A header for the RSA functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: rsa.h 1313 2012-03-27 11:09:31Z michael $ */ #ifndef INCLUDED_rsa_h #define INCLUDED_rsa_h #include "config.h" #ifdef HAVE_LIBCRYPTO extern void report_crypto_errors(void); extern int generate_challenge(char **, char **, RSA *); extern int get_randomness(unsigned char *, int); #endif #endif /* INCLUDED_rsa_h */ ircd-hybrid-8.1.13.dfsg.1/include/packet.h0000644000175000017500000000367112263053413016256 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * packet.h: A header for the packet functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: packet.h 1798 2013-03-31 17:09:50Z michael $ */ #ifndef INCLUDED_packet_h #define INCLUDED_packet_h #include "fdlist.h" /* * this hides in here rather than in defaults.h because it really shouldn't * be tweaked unless you *REALLY REALLY* know what you're doing! * Remember, messages are only anti-flooded on incoming from the client, not on * incoming from a server for a given client, so if you tweak this you risk * allowing a client to flood differently depending upon where they are on * the network.. * -- adrian */ /* MAX_FLOOD is the amount of lines in a 'burst' we allow from a client, * anything beyond MAX_FLOOD is limited to about one line per second. * * MAX_FLOOD_CONN is the amount of lines we allow from a client who has * just connected. this allows clients to rejoin multiple channels * without being so heavily penalised they excess flood. */ #define MAX_FLOOD 5 #define MAX_FLOOD_BURST MAX_FLOOD * 8 PF read_packet; PF flood_recalc; void flood_endgrace(struct Client *); #endif /* INCLUDED_packet_h */ ircd-hybrid-8.1.13.dfsg.1/include/supported.h0000644000175000017500000000462112263053413017030 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * supported.h: Header for 005 numeric etc... * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: supported.h 33 2005-10-02 20:50:00Z knight $ */ #ifndef INCLUDED_supported_h #define INCLUDED_supported_h #include "channel.h" #include "ircd_defs.h" #include "s_serv.h" #define CASEMAP "rfc1459" /* ConfigChannel.use_knock ? " KNOCK" */ /* * - from mirc's versions.txt * * mIRC now supports the numeric 005 tokens: CHANTYPES=# and * PREFIX=(ohv)@%+ and can handle a dynamic set of channel and * nick prefixes. * * mIRC assumes that @ is supported on all networks, any mode * left of @ is assumed to have at least equal power to @, and * any mode right of @ has less power. * * mIRC has internal support for @%+ modes. * * $nick() can now handle all mode letters listed in PREFIX. * * Also added support for CHANMODES=A,B,C,D token (not currently * supported by any servers), which lists all modes supported * by a channel, where: * * A = modes that take a parameter, and add or remove nicks * or addresses to a list, such as +bIe for the ban, * invite, and exception lists. * * B = modes that change channel settings, but which take * a parameter when they are set and unset, such as * +k key, and -k key. * * C = modes that change channel settings, but which take * a parameter only when they are set, such as +l N, * and -l. * * D = modes that change channel settings, such as +imnpst * and take no parameters. * * All unknown/unlisted modes are treated as type D. */ #endif /* INCLUDED_supported_h */ ircd-hybrid-8.1.13.dfsg.1/include/watch.h0000644000175000017500000000355112263053413016112 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 1997 Jukka Santala (Donwulff) * Copyright (C) 2005 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file watch.h * \brief Header including structures and prototypes for WATCH support * \version $Id: watch.h 1857 2013-04-24 20:47:21Z michael $ */ #ifndef INCLUDED_watch_h #define INCLUDED_watch_h /*! \brief Watch structure */ struct Watch { dlink_node node; /**< Embedded dlink_node used to link into watchTable */ dlink_list watched_by; /**< list of clients that have this entry on their watch list */ time_t lasttime; /**< last time the client was seen */ char nick[NICKLEN + 1]; /**< nick name of the client to watch */ }; extern void watch_init(void); extern void watch_add_to_hash_table(const char *, struct Client *); extern void watch_del_from_hash_table(const char *, struct Client *); extern void watch_check_hash(struct Client *, const unsigned int); extern void watch_del_watch_list(struct Client *); extern void watch_count_memory(unsigned int *const, uint64_t *const); extern struct Watch *watch_find_hash(const char *); #endif ircd-hybrid-8.1.13.dfsg.1/include/s_user.h0000644000175000017500000000441512263053413016304 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_user.h: A header for the user functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_user.h 2136 2013-05-29 19:36:51Z michael $ */ #ifndef INCLUDED_s_user_h #define INCLUDED_s_user_h #define IRC_MAXSID 3 #define IRC_MAXUID 6 #define TOTALSIDUID (IRC_MAXSID + IRC_MAXUID) struct Client; extern const unsigned int user_modes[]; extern void assemble_umode_buffer(void); extern void set_user_mode(struct Client *, struct Client *, const int, char *[]); extern void send_umode(struct Client *, struct Client *, unsigned int, unsigned int, char *); extern void send_umode_out(struct Client *, struct Client *, unsigned int); extern void show_lusers(struct Client *); extern void show_isupport(struct Client *); extern void oper_up(struct Client *); extern void register_local_user(struct Client *); extern void register_remote_user(struct Client *, const char *, const char *, const char *, const char *); extern void init_uid(void); extern int valid_sid(const char *); extern int valid_hostname(const char *); extern int valid_username(const char *, const int); extern int valid_nickname(const char *, const int); extern void add_isupport(const char *, const char *, int); extern void delete_isupport(const char *); extern void init_isupport(void); extern void rebuild_isupport_message_line(void); extern void user_set_hostmask(struct Client *, const char *, const int); #endif ircd-hybrid-8.1.13.dfsg.1/include/conf_class.h0000644000175000017500000000540312263053413017114 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file * \brief Configuration managment for class{} blocks * \version $Id: conf_class.h 1785 2013-01-26 22:40:55Z michael $ */ #ifndef INCLUDED_conf_class_h #define INCLUDED_conf_class_h #define CLASS_FLAGS_FAKE_IDLE 0x01 #define CLASS_FLAGS_RANDOM_IDLE 0x02 #define CLASS_FLAGS_HIDE_IDLE_FROM_OPERS 0x04 struct ClassItem { char *name; dlink_node node; dlink_list list_ipv4; /* base of per cidr ipv4 client link list */ dlink_list list_ipv6; /* base of per cidr ipv6 client link list */ unsigned int ref_count; unsigned int max_sendq; unsigned int max_recvq; unsigned int con_freq; unsigned int ping_freq; unsigned int max_total; unsigned int max_local; unsigned int max_global; unsigned int max_ident; unsigned int max_perip; unsigned int min_idle; unsigned int max_idle; unsigned int cidr_bitlen_ipv4; unsigned int cidr_bitlen_ipv6; unsigned int number_per_cidr; unsigned int flags; unsigned int active; }; /* address of default class conf */ extern struct ClassItem *class_default; extern struct ClassItem *class_make(void); extern struct ClassItem *get_class_ptr(const dlink_list *const); extern const dlink_list *class_get_list(void); extern void class_free(struct ClassItem *); extern void class_init(void); extern const char *get_client_class(const dlink_list *const); extern unsigned int get_client_ping(const dlink_list *const); extern unsigned int get_sendq(const dlink_list *const); extern unsigned int get_recvq(const dlink_list *const); extern struct ClassItem *class_find(const char *, int); extern void class_mark_for_deletion(void); extern void class_delete_marked(void); extern void destroy_cidr_class(struct ClassItem *); extern int cidr_limit_reached(int, struct irc_ssaddr *, struct ClassItem *); extern void remove_from_cidr_check(struct irc_ssaddr *, struct ClassItem *); extern void rebuild_cidr_list(struct ClassItem *); #endif ircd-hybrid-8.1.13.dfsg.1/include/parse.h0000644000175000017500000001344212263053413016116 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * parse.h: A header for the message parser. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: parse.h 2434 2013-08-02 18:43:30Z michael $ */ #ifndef INCLUDED_parse_h #define INCLUDED_parse_h struct Client; /* * m_functions execute protocol messages on this server: * int m_func(struct Client* client_p, struct Client* source_p, int parc, char* parv[]); * * client_p is always NON-NULL, pointing to a *LOCAL* client * structure (with an open socket connected!). This * identifies the physical socket where the message * originated (or which caused the m_function to be * executed--some m_functions may call others...). * * source_p is the source of the message, defined by the * prefix part of the message if present. If not * or prefix not found, then source_p==client_p. * * (!IsServer(client_p)) => (client_p == source_p), because * prefixes are taken *only* from servers... * * (IsServer(client_p)) * (source_p == client_p) => the message didn't * have the prefix. * * (source_p != client_p && IsServer(source_p) means * the prefix specified servername. (?) * * (source_p != client_p && !IsServer(source_p) means * that message originated from a remote * user (not local). * * * combining * * (!IsServer(source_p)) means that, source_p can safely * taken as defining the target structure of the * message in this server. * * *Always* true (if 'parse' and others are working correct): * * 1) source_p->from == client_p (note: client_p->from == client_p) * * 2) MyConnect(source_p) <=> source_p == client_p (e.g. source_p * *cannot* be a local connection, unless it's * actually client_p!). [MyConnect(x) should probably * be defined as (x == x->from) --msa ] * * parc number of variable parameter strings (if zero, * parv is allowed to be NULL) * * parv a NULL terminated list of parameter pointers, * * parv[0], sender (prefix string), if not present * this points to an empty string. * parv[1]...parv[parc-1] * pointers to additional parameters * parv[parc] == NULL, *always* * * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ /* * MessageHandler */ typedef enum HandlerType { UNREGISTERED_HANDLER, CLIENT_HANDLER, SERVER_HANDLER, ENCAP_HANDLER, OPER_HANDLER, DUMMY_HANDLER, LAST_HANDLER_TYPE } HandlerType; /* * MessageHandler function * Params: * struct Client* client_p - connection message originated from * struct Client* source_p - source of message, may be different from client_p * int parc - parameter count * char* parv[] - parameter vector */ typedef void (*MessageHandler)(struct Client *, struct Client *, int, char *[]); /* * Message table structure */ struct Message { const char *cmd; unsigned int count; /* number of times command used */ unsigned int rcount; /* number of times command used by server */ unsigned int args_min; /* at least this many args must be passed * or an error will be sent to the user * before the m_func is even called */ unsigned int args_max; /* maximum permitted parameters */ unsigned int flags; /* bit 0 set means that this command is allowed * to be used only on the average of once per 2 * seconds -SRB */ uint64_t bytes; /* bytes received for this message */ /* * client_p = Connected client ptr * source_p = Source client ptr * parc = parameter count * parv = parameter variable array */ /* handlers: * UNREGISTERED, CLIENT, SERVER, ENCAP, OPER, DUMMY, LAST */ MessageHandler handlers[LAST_HANDLER_TYPE]; }; /* * Constants */ #define MFLG_SLOW 0x001 /* Command can be executed roughly * once per 2 seconds. */ #define MAXPARA 15 extern void parse(struct Client *, char *, char *); extern void mod_add_cmd(struct Message *); extern void mod_del_cmd(struct Message *); extern struct Message *find_command(const char *); extern void report_messages(struct Client *); /* generic handlers */ extern void m_ignore(struct Client *, struct Client *, int, char *[]); extern void m_not_oper(struct Client *, struct Client *, int, char *[]); extern void m_registered(struct Client *, struct Client *, int, char *[]); extern void m_unregistered(struct Client *, struct Client *, int, char *[]); #endif /* INCLUDED_parse_h */ ircd-hybrid-8.1.13.dfsg.1/include/irc_res.h0000644000175000017500000000505012263053413016426 0ustar domdom/* * include/irc_res.h for referencing functions in src/irc_res.c * * $Id: irc_res.h 1180 2011-08-16 08:00:56Z michael $ */ #ifndef INCLUDED_irc_res_h #define INCLUDED_irc_res_h #include "config.h" struct Client; /* XXX */ /* Here we define some values lifted from nameser.h */ #define NS_NOTIFY_OP 4 #define NS_INT16SZ 2 #define NS_IN6ADDRSZ 16 #define NS_INADDRSZ 4 #define NS_INT32SZ 4 #define NS_CMPRSFLGS 0xc0 #define NS_MAXCDNAME 255 #define QUERY 0 #define IQUERY 1 #define NO_ERRORS 0 #define SERVFAIL 2 #define NXDOMAIN 3 #define T_A 1 #define T_AAAA 28 #define T_PTR 12 #define T_CNAME 5 #define T_NULL 10 #define C_IN 1 #define QFIXEDSZ 4 #define RRFIXEDSZ 10 #define HFIXEDSZ 12 typedef struct { unsigned id :16; /* query identification number */ #ifdef WORDS_BIGENDIAN /* fields in third byte */ unsigned qr: 1; /* response flag */ unsigned opcode: 4; /* purpose of message */ unsigned aa: 1; /* authoritive answer */ unsigned tc: 1; /* truncated message */ unsigned rd: 1; /* recursion desired */ /* fields in fourth byte */ unsigned ra: 1; /* recursion available */ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ unsigned ad: 1; /* authentic data from named */ unsigned cd: 1; /* checking disabled by resolver */ unsigned rcode :4; /* response code */ #else /* fields in third byte */ unsigned rd :1; /* recursion desired */ unsigned tc :1; /* truncated message */ unsigned aa :1; /* authoritive answer */ unsigned opcode :4; /* purpose of message */ unsigned qr :1; /* response flag */ /* fields in fourth byte */ unsigned rcode :4; /* response code */ unsigned cd: 1; /* checking disabled by resolver */ unsigned ad: 1; /* authentic data from named */ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */ unsigned ra :1; /* recursion available */ #endif /* remaining bytes */ unsigned qdcount :16; /* number of question entries */ unsigned ancount :16; /* number of answer entries */ unsigned nscount :16; /* number of authority entries */ unsigned arcount :16; /* number of resource entries */ } HEADER; typedef void (*dns_callback_fnc)(void *, const struct irc_ssaddr *, const char *); extern void init_resolver(void); extern void restart_resolver(void); extern void delete_resolver_queries(const void *); extern void report_dns_servers(struct Client *); extern void gethost_byname_type(dns_callback_fnc , void *, const char *, int); extern void gethost_byname(dns_callback_fnc, void *, const char *); extern void gethost_byaddr(dns_callback_fnc, void *, const struct irc_ssaddr *); #endif ircd-hybrid-8.1.13.dfsg.1/include/listener.h0000644000175000017500000000370112263053413016626 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * listener.h: A header for the listener code. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: listener.h 1798 2013-03-31 17:09:50Z michael $ */ #ifndef INCLUDED_listener_h #define INCLUDED_listener_h #define LISTENER_SSL 0x1 #define LISTENER_HIDDEN 0x2 #define LISTENER_SERVER 0x4 #include "ircd_defs.h" #include "fdlist.h" struct Client; struct Listener { dlink_node node; /* list node pointer */ fde_t fd; /* file descriptor */ int port; /* listener IP port */ int ref_count; /* number of connection references */ int active; /* current state of listener */ struct irc_ssaddr addr; /* virtual address or INADDR_ANY */ char name[HOSTLEN + 1]; /* virtual name of listener */ unsigned int flags; }; extern void add_listener(int, const char *, unsigned int); extern void close_listeners(void); extern const char *get_listener_name(const struct Listener *const); extern void show_ports(struct Client *); extern void free_listener(struct Listener *); #endif /* INCLUDED_listener_h */ ircd-hybrid-8.1.13.dfsg.1/include/hostmask.h0000644000175000017500000000525312263053413016636 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * hostmask.h: A header for the hostmask code. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hostmask.h 1644 2012-11-06 22:20:16Z michael $ */ #ifndef INCLUDE_hostmask_h #define INCLUDE_hostmask_h 1 #define ATABLE_SIZE 0x1000 enum hostmask_type { HM_HOST, HM_IPV4, HM_IPV6 }; struct AddressRec { /* masktype: HM_HOST, HM_IPV4, HM_IPV6 -A1kmm */ enum hostmask_type masktype; /* type: CONF_CLIENT, CONF_DLINE, CONF_KLINE etc... -A1kmm */ enum maskitem_type type; union { struct { /* Pointer into MaskItem... -A1kmm */ struct irc_ssaddr addr; int bits; } ipa; /* Pointer into MaskItem... -A1kmm */ const char *hostname; } Mask; /* Higher precedences overrule lower ones... */ unsigned int precedence; /* Only checked if !(type & 1)... */ const char *username; struct MaskItem *conf; dlink_node node; }; extern dlink_list atable[ATABLE_SIZE]; extern int parse_netmask(const char *, struct irc_ssaddr *, int *); extern int match_ipv6(const struct irc_ssaddr *, const struct irc_ssaddr *, int); extern int match_ipv4(const struct irc_ssaddr *, const struct irc_ssaddr *, int); extern void mask_addr(struct irc_ssaddr *, int); extern void init_host_hash(void); extern void add_conf_by_address(const unsigned int, struct MaskItem *); extern void delete_one_address_conf(const char *, struct MaskItem *); extern void clear_out_address_conf(void); extern void hostmask_expire_temporary(void); extern struct MaskItem *find_address_conf(const char *, const char *, struct irc_ssaddr *, int, char *); extern struct MaskItem *find_dline_conf(struct irc_ssaddr *, int); extern struct MaskItem *find_conf_by_address(const char *, struct irc_ssaddr *, unsigned int, int, const char *, const char *, int); #endif /* INCLUDE_hostmask_h */ ircd-hybrid-8.1.13.dfsg.1/include/conf.h0000644000175000017500000003071212263053413015730 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * conf.h: A header for the configuration functions. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: conf.h 2523 2013-11-01 20:44:22Z michael $ */ #ifndef INCLUDED_s_conf_h #define INCLUDED_s_conf_h #include "config.h" #include "ircd_defs.h" #include "client.h" #include "hook.h" #include "conf_class.h" #define CONF_NOREASON "" #define IsConfOperator(x) ((x)->type == CONF_OPER) #define IsConfKill(x) ((x)->type == CONF_KLINE) #define IsConfClient(x) ((x)->type == CONF_CLIENT) #define IsConfGline(x) ((x)->type == CONF_GLINE) /* MaskItem->flags */ #define CONF_FLAGS_DO_IDENTD 0x00000001 #define CONF_FLAGS_LIMIT_IP 0x00000002 #define CONF_FLAGS_NO_TILDE 0x00000004 #define CONF_FLAGS_NEED_IDENTD 0x00000008 #define CONF_FLAGS_NOMATCH_IP 0x00000010 #define CONF_FLAGS_EXEMPTKLINE 0x00000020 #define CONF_FLAGS_NOLIMIT 0x00000040 #define CONF_FLAGS_SPOOF_IP 0x00000080 #define CONF_FLAGS_SPOOF_NOTICE 0x00000100 #define CONF_FLAGS_REDIR 0x00000200 #define CONF_FLAGS_EXEMPTGLINE 0x00000400 #define CONF_FLAGS_CAN_FLOOD 0x00000800 #define CONF_FLAGS_NEED_PASSWORD 0x00001000 #define CONF_FLAGS_ALLOW_AUTO_CONN 0x00002000 #define CONF_FLAGS_ENCRYPTED 0x00004000 #define CONF_FLAGS_IN_DATABASE 0x00008000 #define CONF_FLAGS_EXEMPTRESV 0x00010000 #define CONF_FLAGS_SSL 0x00020000 #define CONF_FLAGS_WEBIRC 0x00040000 /* Macros for struct MaskItem */ #define IsConfWebIRC(x) ((x)->flags & CONF_FLAGS_WEBIRC) #define IsLimitIp(x) ((x)->flags & CONF_FLAGS_LIMIT_IP) #define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE) #define IsConfCanFlood(x) ((x)->flags & CONF_FLAGS_CAN_FLOOD) #define IsNeedPassword(x) ((x)->flags & CONF_FLAGS_NEED_PASSWORD) #define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD) #define IsNoMatchIp(x) ((x)->flags & CONF_FLAGS_NOMATCH_IP) #define IsConfExemptKline(x) ((x)->flags & CONF_FLAGS_EXEMPTKLINE) #define IsConfExemptLimits(x) ((x)->flags & CONF_FLAGS_NOLIMIT) #define IsConfExemptGline(x) ((x)->flags & CONF_FLAGS_EXEMPTGLINE) #define IsConfExemptResv(x) ((x)->flags & CONF_FLAGS_EXEMPTRESV) #define IsConfDoIdentd(x) ((x)->flags & CONF_FLAGS_DO_IDENTD) #define IsConfDoSpoofIp(x) ((x)->flags & CONF_FLAGS_SPOOF_IP) #define IsConfSpoofNotice(x) ((x)->flags & CONF_FLAGS_SPOOF_NOTICE) #define IsConfEncrypted(x) ((x)->flags & CONF_FLAGS_ENCRYPTED) #define SetConfEncrypted(x) ((x)->flags |= CONF_FLAGS_ENCRYPTED) #define ClearConfEncrypted(x) ((x)->flags &= ~CONF_FLAGS_ENCRYPTED) #define IsConfAllowAutoConn(x) ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN) #define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN) #define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN) #define IsConfRedir(x) ((x)->flags & CONF_FLAGS_REDIR) #define IsConfSSL(x) ((x)->flags & CONF_FLAGS_SSL) #define SetConfSSL(x) ((x)->flags |= CONF_FLAGS_SSL) #define ClearConfSSL(x) ((x)->flags &= ~CONF_FLAGS_SSL) #define IsConfDatabase(x) ((x)->flags & CONF_FLAGS_IN_DATABASE) #define SetConfDatabase(x) ((x)->flags |= CONF_FLAGS_IN_DATABASE) /* shared/cluster server entry types * These defines are used for both shared and cluster. */ #define SHARED_KLINE 0x0001 #define SHARED_UNKLINE 0x0002 #define SHARED_XLINE 0x0004 #define SHARED_UNXLINE 0x0008 #define SHARED_RESV 0x0010 #define SHARED_UNRESV 0x0020 #define SHARED_LOCOPS 0x0040 #define SHARED_DLINE 0x0080 #define SHARED_UNDLINE 0x0100 #define SHARED_ALL (SHARED_KLINE | SHARED_UNKLINE |\ SHARED_XLINE | SHARED_UNXLINE |\ SHARED_RESV | SHARED_UNRESV |\ SHARED_LOCOPS | SHARED_DLINE | SHARED_UNDLINE) enum maskitem_type { CONF_RESERVED = 1 << 0, /* XXX */ CONF_CLIENT = 1 << 1, CONF_SERVER = 1 << 2, CONF_KLINE = 1 << 3, CONF_DLINE = 1 << 4, CONF_EXEMPT = 1 << 5, CONF_CLUSTER = 1 << 6, CONF_XLINE = 1 << 7, CONF_ULINE = 1 << 8, CONF_GLINE = 1 << 9, CONF_CRESV = 1 << 10, CONF_NRESV = 1 << 11, CONF_SERVICE = 1 << 12, CONF_OPER = 1 << 13, }; struct conf_parser_context { unsigned int boot; unsigned int pass; FILE *conf_file; }; struct split_nuh_item { dlink_node node; char *nuhmask; char *nickptr; char *userptr; char *hostptr; size_t nicksize; size_t usersize; size_t hostsize; }; struct MaskItem { dlink_node node; dlink_list leaf_list; dlink_list hub_list; dlink_list exempt_list; enum maskitem_type type; unsigned int dns_failed; unsigned int dns_pending; unsigned int flags; unsigned int modes; unsigned int port; unsigned int count; unsigned int aftype; unsigned int active; unsigned int htype; unsigned int ref_count; /* Number of *LOCAL* clients using this */ int bits; time_t until; /* Hold action until this time (calendar time) */ time_t setat; struct irc_ssaddr bind; /* ip to bind to for outgoing connect */ struct irc_ssaddr addr; /* ip to connect to */ struct ClassItem *class; /* Class of connection */ char *name; char *user; /* user part of user@host */ char *host; /* host part of user@host */ char *passwd; char *spasswd; /* Password to send. */ char *reason; char *certfp; char *cipher_list; void *rsa_public_key; }; struct exempt { dlink_node node; char *name; char *user; char *host; size_t len; time_t when; struct irc_ssaddr addr; int bits; int type; int coid; }; struct CidrItem { dlink_node node; struct irc_ssaddr mask; unsigned int number_on_this_cidr; }; struct config_file_entry { const char *dpath; /* DPATH if set from command line */ const char *configfile; const char *klinefile; const char *glinefile; const char *xlinefile; const char *dlinefile; const char *resvfile; char *mpath; char *rpath; char *egdpool_path; char *service_name; int gline_min_cidr; int gline_min_cidr6; int dots_in_ident; int failed_oper_notice; int anti_spam_exit_message_time; unsigned int max_accept; unsigned int max_watch; int max_nick_time; unsigned int max_nick_changes; int ts_max_delta; int ts_warn_delta; int anti_nick_flood; int warn_no_nline; int invisible_on_connect; int stats_e_disabled; int stats_o_oper_only; int stats_k_oper_only; int stats_i_oper_only; int stats_P_oper_only; int stats_u_oper_only; int short_motd; int no_oper_flood; int true_no_oper_flood; int oper_pass_resv; int glines; int hide_spoof_ips; int tkline_expire_notices; int opers_bypass_callerid; int ignore_bogus_ts; int pace_wait; int pace_wait_simple; int gline_time; int gline_request_time; int oper_only_umodes; int oper_umodes; int max_targets; int caller_id_wait; int min_nonwildcard; int min_nonwildcard_simple; int kill_chase_time_limit; int default_floodcount; /* 0 == don't use throttle... */ int throttle_time; int use_egd; int ping_cookie; int disable_auth; int cycle_on_host_change; }; struct config_channel_entry { int disable_fake_channels; int knock_delay; int knock_delay_channel; unsigned int max_bans; unsigned int max_chans_per_user; unsigned int max_chans_per_oper; int no_create_on_split; int no_join_on_split; int default_split_server_count; int default_split_user_count; }; struct config_server_hide { char *hidden_name; int flatten_links; int disable_remote_commands; int hide_servers; int hide_services; int links_delay; int links_disabled; int hidden; int hide_server_ips; }; struct server_info { char *sid; char *name; char *description; char *network_name; char *network_desc; char *rsa_private_key_file; void *rsa_private_key; void *server_ctx; void *client_ctx; int hub; struct irc_ssaddr ip; struct irc_ssaddr ip6; unsigned int max_clients; unsigned int max_nick_length; unsigned int max_topic_length; int specific_ipv4_vhost; int specific_ipv6_vhost; struct sockaddr_in dns_host; int can_use_v6; }; struct admin_info { char *name; char *description; char *email; }; struct logging_entry { unsigned int use_logging; }; extern dlink_list flatten_links; extern dlink_list server_items; extern dlink_list cluster_items; extern dlink_list xconf_items; extern dlink_list uconf_items; extern dlink_list oconf_items; extern dlink_list service_items; extern dlink_list nresv_items; extern dlink_list cresv_items; extern struct conf_parser_context conf_parser_ctx; extern struct logging_entry ConfigLoggingEntry; extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/ extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/ extern struct config_server_hide ConfigServerHide; /* defined in s_conf.c */ extern struct server_info ServerInfo; /* defined in ircd.c */ extern struct admin_info AdminInfo; /* defined in ircd.c */ extern int valid_wild_card_simple(const char *); extern int valid_wild_card(struct Client *, int, int, ...); /* End GLOBAL section */ extern void init_ip_hash_table(void); extern void count_ip_hash(unsigned int *, uint64_t *); extern void remove_one_ip(struct irc_ssaddr *); extern struct MaskItem *conf_make(enum maskitem_type); extern void read_conf_files(int); extern int attach_conf(struct Client *, struct MaskItem *); extern int attach_connect_block(struct Client *, const char *, const char *); extern int check_client(struct Client *); extern void detach_conf(struct Client *, enum maskitem_type); extern struct MaskItem *find_conf_name(dlink_list *, const char *, enum maskitem_type); extern int conf_connect_allowed(struct irc_ssaddr *, int); extern char *oper_privs_as_string(const unsigned int); extern void split_nuh(struct split_nuh_item *); extern struct MaskItem *find_matching_name_conf(enum maskitem_type, const char *, const char *, const char *, unsigned int); extern struct MaskItem *find_exact_name_conf(enum maskitem_type, const struct Client *, const char *, const char *, const char *); extern void conf_free(struct MaskItem *); extern void yyerror(const char *); extern void conf_error_report(const char *); extern void cleanup_tklines(void *); extern int rehash(int); extern void lookup_confhost(struct MaskItem *); extern void conf_add_class_to_conf(struct MaskItem *, const char *); extern const char *get_oper_name(const struct Client *); /* XXX should the parse_aline stuff go into another file ?? */ #define AWILD 0x1 /* check wild cards */ extern int parse_aline(const char *, struct Client *, int, char **, int, char **, char **, time_t *, char **, char **); extern int valid_comment(struct Client *, char *, int); #define TK_SECONDS 0 #define TK_MINUTES 1 extern time_t valid_tkline(const char *, const int); extern int match_conf_password(const char *, const struct MaskItem *); #define NOT_AUTHORIZED (-1) #define I_LINE_FULL (-2) #define TOO_MANY (-3) #define BANNED_CLIENT (-4) #define TOO_FAST (-5) #define CLEANUP_TKLINES_TIME 60 extern void cluster_a_line(struct Client *, const char *, int, int, const char *,...); #endif /* INCLUDED_s_conf_h */ ircd-hybrid-8.1.13.dfsg.1/include/restart.h0000644000175000017500000000214012263053413016461 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * restart.h: A header with restart functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: restart.h 33 2005-10-02 20:50:00Z knight $ */ #ifndef INCLUDED_restart_h #define INCLUDED_restart_h extern void restart(const char *); extern void server_die(const char *, int); #endif ircd-hybrid-8.1.13.dfsg.1/include/ircd_getopt.h0000644000175000017500000000264412263053413017311 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd_getopt.h: A header for the getopt() command line option calls. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd_getopt.h 1357 2012-04-21 20:47:01Z michael $ */ #ifndef __GETOPT_H_INCLUDED__ #define __GETOPT_H_INCLUDED__ struct lgetopt { const char *opt; /* name of the argument */ void *argloc; /* where we store the argument to it (-option argument) */ enum { INTEGER, YESNO, STRING, USAGE, ENDEBUG } argtype; const char *desc; /* description of the argument, usage for printing help */ }; extern void parseargs(int *, char ***, struct lgetopt *); #endif /* __GETOPT_H_INCLUDED__ */ ircd-hybrid-8.1.13.dfsg.1/include/whowas.h0000644000175000017500000000505712263053413016317 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * whowas.h: Header for the whowas functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: whowas.h 2747 2014-01-05 19:19:06Z michael $ */ #ifndef INCLUDED_whowas_h #define INCLUDED_whowas_h #include "ircd_defs.h" #include "client.h" #include "config.h" struct Whowas { int hashv; int shide; time_t logoff; char name[NICKLEN + 1]; char username[USERLEN + 1]; char hostname[HOSTLEN + 1]; char realname[REALLEN + 1]; char servername[HOSTLEN + 1]; struct Client *online; /* Pointer to new nickname for chasing or NULL */ dlink_node tnode; /* for hash table... */ dlink_node cnode; /* for client struct linked list */ }; /* ** initwhowas */ extern void whowas_init(void); /* ** whowas_add_history ** Add the currently defined name of the client to history. ** usually called before changing to a new name (nick). ** Client must be a fully registered user. */ extern void whowas_add_history(struct Client *, const int); /* ** whowas_off_history ** This must be called when the client structure is about to ** be released. History mechanism keeps pointers to client ** structures and it must know when they cease to exist. This ** also implicitly calls AddHistory. */ extern void whowas_off_history(struct Client *); /* ** whowas_get_history ** Return the current client that was using the given ** nickname within the timelimit. Returns NULL, if no ** one found... */ extern struct Client *whowas_get_history(const char *, time_t); /* ** for debugging...counts related structures stored in whowas array. */ extern void whowas_count_memory(unsigned int *const, uint64_t *const); extern dlink_list WHOWASHASH[]; #endif /* INCLUDED_whowas_h */ ircd-hybrid-8.1.13.dfsg.1/include/modules.h0000644000175000017500000000406312263053413016453 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * modules.h: A header for the modules functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: modules.h 1737 2013-01-14 17:37:55Z michael $ */ #ifndef INCLUDED_modules_h #define INCLUDED_modules_h #include "config.h" #define MODULE_FLAG_CORE 0x1 #define MODULE_FLAG_NOUNLOAD 0x2 struct module { dlink_node node; char *name; const char *version; void *handle; void (*modinit)(void); void (*modexit)(void); unsigned int flags; }; struct module_path { dlink_node node; char path[HYB_PATH_MAX + 1]; }; extern dlink_list modules_list; /* add a path */ extern void mod_add_path(const char *); extern void mod_clear_paths(void); /* load all modules */ extern void load_all_modules(int); /* load core modules */ extern void load_core_modules(int); /* Add this module to list of modules to be loaded from conf */ extern void add_conf_module(const char *); /* load all modules listed in conf */ extern void load_conf_modules(void); extern void modules_init(void); extern int unload_one_module(const char *, int); extern int modules_valid_suffix(const char *); extern int load_one_module(const char *); extern int load_a_module(const char *, int); extern struct module *findmodule_byname(const char *); #endif /* INCLUDED_modules_h */ ircd-hybrid-8.1.13.dfsg.1/include/s_serv.h0000644000175000017500000001045512263053413016306 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_serv.h: A header for the server functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_serv.h 2294 2013-06-19 10:54:30Z michael $ */ #ifndef INCLUDED_serv_h #define INCLUDED_serv_h #include "config.h" struct MaskItem; /* * number of seconds to wait after server starts up, before * starting try_connections() * TOO SOON and you can nick collide like crazy. */ #define STARTUP_CONNECTIONS_TIME 60 struct Client; struct MaskItem; struct Channel; /* Capabilities */ struct Capability { dlink_node node; char *name; /* name of capability */ unsigned int cap; /* mask value */ }; #define CAP_CAP 0x00000001 /* received a CAP to begin with */ #define CAP_QS 0x00000002 /* Can handle quit storm removal */ #define CAP_EX 0x00000004 /* Can do channel +e exemptions */ #define CAP_CHW 0x00000008 /* Can do channel wall @# */ #define CAP_IE 0x00000010 /* Can do invite exceptions */ #define CAP_EOB 0x00000020 /* Can do EOB message */ #define CAP_KLN 0x00000040 /* Can do KLINE message */ #define CAP_GLN 0x00000080 /* Can do GLINE message */ #define CAP_TS6 0x00000100 /* Can do TS6 */ #define CAP_KNOCK 0x00000200 /* supports KNOCK */ #define CAP_UNKLN 0x00000400 /* Can do UNKLINE message */ #define CAP_CLUSTER 0x00000800 /* supports server clustering */ #define CAP_ENCAP 0x00001000 /* supports ENCAP message */ #define CAP_HOPS 0x00002000 /* supports HALFOPS */ #define CAP_TBURST 0x00004000 /* supports TBURST */ #define CAP_SVS 0x00008000 /* supports services */ #define CAP_DLN 0x00010000 /* Can do DLINE message */ #define CAP_UNDLN 0x00020000 /* Can do UNDLINE message */ #define CAP_FAKEHOST 0x00040000 /* supports fake hosts */ /* * Capability macros. */ #define IsCapable(x, cap) ((x)->localClient->caps & (cap)) #define SetCapable(x, cap) ((x)->localClient->caps |= (cap)) #define ClearCap(x, cap) ((x)->localClient->caps &= ~(cap)) /* * return values for hunt_server() */ #define HUNTED_NOSUCH (-1) /* if the hunted server is not found */ #define HUNTED_ISME 0 /* if this server should execute the command */ #define HUNTED_PASS 1 /* if message passed onwards successfully */ extern int valid_servname(const char *); extern int check_server(const char *, struct Client *); extern int hunt_server(struct Client *, struct Client *, const char *, const int, const int, char *[]); extern void add_capability(const char *, int, int); extern int delete_capability(const char *); extern int unsigned find_capability(const char *); extern void send_capabilities(struct Client *, int); extern void write_links_file(void *); extern void read_links_file(void); extern void server_estab(struct Client *); extern const char *show_capabilities(const struct Client *); extern void try_connections(void *); extern void burst_channel(struct Client *client_p, struct Channel *); extern void sendnick_TS(struct Client *, struct Client *); extern int serv_connect(struct MaskItem *, struct Client *); extern struct Client *find_servconn_in_progress(const char *); extern struct Server *make_server(struct Client *); #endif /* INCLUDED_s_serv_h */ ircd-hybrid-8.1.13.dfsg.1/include/fdlist.h0000644000175000017500000000577312263053413016301 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * fdlist.h: The file descriptor list header. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: fdlist.h 1736 2013-01-13 09:31:46Z michael $ */ #ifndef INCLUDED_fdlist_h #define INCLUDED_fdlist_h #define FILEIO_V2 #include "ircd_defs.h" #define FD_DESC_SZ 128 /* hostlen + comment */ enum { COMM_OK, COMM_ERR_BIND, COMM_ERR_DNS, COMM_ERR_TIMEOUT, COMM_ERR_CONNECT, COMM_ERROR, COMM_ERR_MAX }; struct _fde; struct Client; /* Callback for completed IO events */ typedef void PF(struct _fde *, void *); /* Callback for completed connections */ /* int fd, int status, void * */ typedef void CNCB(struct _fde *, int, void *); typedef struct _fde { /* New-school stuff, again pretty much ripped from squid */ /* * Yes, this gives us only one pending read and one pending write per * filedescriptor. Think though: when do you think we'll need more? */ int fd; /* So we can use the fde_t as a callback ptr */ int comm_index; /* where in the poll list we live */ int evcache; /* current fd events as set up by the underlying I/O */ char desc[FD_DESC_SZ]; PF *read_handler; void *read_data; PF *write_handler; void *write_data; PF *timeout_handler; void *timeout_data; time_t timeout; PF *flush_handler; void *flush_data; time_t flush_timeout; struct { unsigned int open:1; unsigned int is_socket:1; #ifdef HAVE_LIBCRYPTO unsigned int pending_read:1; #endif } flags; struct { /* We don't need the host here ? */ struct irc_ssaddr S; struct irc_ssaddr hostaddr; CNCB *callback; void *data; /* We'd also add the retry count here when we get to that -- adrian */ } connect; #ifdef HAVE_LIBCRYPTO SSL *ssl; #endif struct _fde *hnext; } fde_t; #define FD_HASH_SIZE 1024 extern int number_fd; extern int hard_fdlimit; extern fde_t *fd_hash[]; extern fde_t *fd_next_in_loop; extern void fdlist_init(void); extern fde_t *lookup_fd(int); extern void fd_open(fde_t *, int, int, const char *); extern void fd_close(fde_t *); extern void fd_dump(struct Client *); extern void fd_note(fde_t *, const char *, ...); extern void close_standard_fds(void); extern void close_fds(fde_t *); #endif /* INCLUDED_fdlist_h */ ircd-hybrid-8.1.13.dfsg.1/include/dbuf.h0000644000175000017500000000272612263053413015727 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * dbuf.h: A header for the dynamic buffers functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: dbuf.h 1011 2009-09-18 10:14:09Z michael $ */ #ifndef __DBUF_H_INCLUDED #define __DBUF_H_INCLUDED #define DBUF_BLOCK_SIZE 1024 /* this is also our MTU used for sending */ #define dbuf_length(x) ((x)->total_size) #define dbuf_clear(x) dbuf_delete(x, dbuf_length(x)) struct dbuf_block { size_t size; char data[DBUF_BLOCK_SIZE]; }; struct dbuf_queue { dlink_list blocks; size_t total_size; }; extern void dbuf_init(void); extern void dbuf_put(struct dbuf_queue *, char *, size_t); extern void dbuf_delete(struct dbuf_queue *, size_t); #endif ircd-hybrid-8.1.13.dfsg.1/include/rng_mt.h0000644000175000017500000000425212263053413016271 0ustar domdom/* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) $Id: rng_mt.h 1662 2012-11-17 20:11:33Z michael $ */ #ifndef __include_rng_mt_header__ #define __include_rng_mt_header__ extern void init_genrand(uint32_t); extern void init_by_array(uint32_t[], int); extern uint32_t genrand_int32(void); #endif ircd-hybrid-8.1.13.dfsg.1/include/irc_string.h0000644000175000017500000001074412263053413017151 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * irc_string.h: A header for the ircd string functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: irc_string.h 1920 2013-04-30 14:51:30Z michael $ */ #ifndef INCLUDED_irc_string_h #define INCLUDED_irc_string_h #include "config.h" extern int has_wildcards(const char *); extern int match(const char *, const char *); /* * collapse - collapse a string in place, converts multiple adjacent *'s * into a single *. * collapse - modifies the contents of pattern */ extern char *collapse(char *); /* * NOTE: The following functions are NOT the same as strcasecmp * and strncasecmp! These functions use the Finnish (RFC1459) * character set. Do not replace! * * irccmp - case insensitive comparison of s1 and s2 */ extern int irccmp(const char *, const char *); /* * ircncmp - counted case insensitive comparison of s1 and s2 */ extern int ircncmp(const char *, const char *, size_t); #ifndef HAVE_STRLCPY extern size_t strlcpy(char *, const char *, size_t); #endif #ifndef HAVE_STRLCAT extern size_t strlcat(char *, const char *, size_t); #endif extern const char *libio_basename(const char *); /* * strip_tabs - convert tabs to spaces * - jdc */ extern void strip_tabs(char *, const char *, size_t); const char *myctime(time_t); #define EmptyString(x) (!(x) || (*(x) == '\0')) #ifndef HAVE_STRTOK_R extern char *strtoken(char **, char *, const char *); #endif /* * character macros */ extern const unsigned char ToLowerTab[]; #define ToLower(c) (ToLowerTab[(unsigned char)(c)]) extern const unsigned char ToUpperTab[]; #define ToUpper(c) (ToUpperTab[(unsigned char)(c)]) extern const unsigned int CharAttrs[]; #define PRINT_C 0x00001 #define CNTRL_C 0x00002 #define ALPHA_C 0x00004 #define PUNCT_C 0x00008 #define DIGIT_C 0x00010 #define SPACE_C 0x00020 #define NICK_C 0x00040 #define CHAN_C 0x00080 #define KWILD_C 0x00100 #define CHANPFX_C 0x00200 #define USER_C 0x00400 #define HOST_C 0x00800 #define NONEOS_C 0x01000 #define SERV_C 0x02000 #define EOL_C 0x04000 #define MWILD_C 0x08000 #define VCHAN_C 0x10000 #define IsVisibleChanChar(c) (CharAttrs[(unsigned char)(c)] & VCHAN_C) #define IsHostChar(c) (CharAttrs[(unsigned char)(c)] & HOST_C) #define IsUserChar(c) (CharAttrs[(unsigned char)(c)] & USER_C) #define IsChanPrefix(c) (CharAttrs[(unsigned char)(c)] & CHANPFX_C) #define IsChanChar(c) (CharAttrs[(unsigned char)(c)] & CHAN_C) #define IsKWildChar(c) (CharAttrs[(unsigned char)(c)] & KWILD_C) #define IsMWildChar(c) (CharAttrs[(unsigned char)(c)] & MWILD_C) #define IsNickChar(c) (CharAttrs[(unsigned char)(c)] & NICK_C) #define IsServChar(c) (CharAttrs[(unsigned char)(c)] & (NICK_C | SERV_C)) #define IsCntrl(c) (CharAttrs[(unsigned char)(c)] & CNTRL_C) #define IsAlpha(c) (CharAttrs[(unsigned char)(c)] & ALPHA_C) #define IsSpace(c) (CharAttrs[(unsigned char)(c)] & SPACE_C) #define IsLower(c) (IsAlpha((c)) && ((unsigned char)(c) > 0x5f)) #define IsUpper(c) (IsAlpha((c)) && ((unsigned char)(c) < 0x60)) #define IsDigit(c) (CharAttrs[(unsigned char)(c)] & DIGIT_C) #define IsXDigit(c) (IsDigit(c) || ('a' <= (c) && (c) <= 'f') || \ ('A' <= (c) && (c) <= 'F')) #define IsAlNum(c) (CharAttrs[(unsigned char)(c)] & (DIGIT_C | ALPHA_C)) #define IsPrint(c) (CharAttrs[(unsigned char)(c)] & PRINT_C) #define IsAscii(c) ((unsigned char)(c) < 0x80) #define IsGraph(c) (IsPrint((c)) && ((unsigned char)(c) != 0x32)) #define IsPunct(c) (!(CharAttrs[(unsigned char)(c)] & \ (CNTRL_C | ALPHA_C | DIGIT_C))) #define IsNonEOS(c) (CharAttrs[(unsigned char)(c)] & NONEOS_C) #define IsEol(c) (CharAttrs[(unsigned char)(c)] & EOL_C) #endif /* INCLUDED_irc_string_h */ ircd-hybrid-8.1.13.dfsg.1/include/s_misc.h0000644000175000017500000000335312263053413016261 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_misc.h: A header for the miscellaneous functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_misc.h 1847 2013-04-23 16:42:02Z michael $ */ #ifndef INCLUDED_s_misc_h #define INCLUDED_s_misc_h extern const char *date(time_t); extern const char *smalldate(time_t); #ifdef HAVE_LIBCRYPTO extern const char *ssl_get_cipher(const SSL *); #endif /* Just blindly define our own MIN/MAX macro */ #define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b)) #define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b)) #define _1MEG (1024.0f) #define _1GIG (1024.0f*1024.0f) #define _1TER (1024.0f*1024.0f*1024.0f) #define _GMKs(x) (((x) > _1TER) ? "Terabytes" : (((x) > _1GIG) ? "Gigabytes" :\ (((x) > _1MEG) ? "Megabytes" : "Kilobytes"))) #define _GMKv(x) (((x) > _1TER) ? (float)((x)/_1TER) : (((x) > _1GIG) ? \ (float)((x)/_1GIG) : (((x) > _1MEG) ? (float)((x)/_1MEG) : \ (float)(x)))) #endif ircd-hybrid-8.1.13.dfsg.1/include/stdinc.h0000644000175000017500000000425112263053413016266 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * stdinc.h: Pull in all of the necessary system headers * * Copyright (C) 2002 Aaron Sethman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: stdinc.h 1858 2013-04-25 15:00:52Z michael $ * */ #ifndef STDINC_H /* prevent multiple #includes */ #define STDINC_H #include "config.h" #include "defaults.h" #include #include #include #include #include #ifdef HAVE_STRTOK_R # define strtoken(x, y, z) strtok_r(y, z, x) #endif #include #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_LIBCRYPTO #include #include #endif #ifdef HAVE_LIBGEOIP #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_RESOURCE_H #include #endif #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef PATH_MAX #define HYB_PATH_MAX PATH_MAX #else #define HYB_PATH_MAX 4096 #endif #if 0 && __GNUC__ #define AFP(a,b) __attribute__((format (printf, a, b))) #else #define AFP(a,b) #endif #endif ircd-hybrid-8.1.13.dfsg.1/include/defaults.h0000644000175000017500000001216012263053413016607 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * defaults.h: The ircd defaults header for values and paths. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: defaults.h 2162 2013-06-02 18:41:10Z michael $ */ #ifndef INCLUDED_defaults_h #define INCLUDED_defaults_h /* Here are some default paths. Most except DPATH are * configurable at runtime. */ /* * Directory paths and filenames for UNIX systems. * PREFIX is set using ./configure --prefix, see INSTALL. * The other defaults should be fine. * * NOTE: CHANGING THESE WILL NOT ALTER THE DIRECTORY THAT FILES WILL * BE INSTALLED TO. IF YOU CHANGE THESE, DO NOT USE MAKE INSTALL, * BUT COPY THE FILES MANUALLY TO WHERE YOU WANT THEM. * * PREFIX = prefix for all directories * DPATH = root directory of installation * BINPATH = directory for binary files * MSGPATH = directory for language files * ETCPATH = directory for configuration files * LOGPATH = directory for logfiles * MODPATH = directory for modules * AUTOMODPATH = directory for autoloaded modules */ /* dirs */ #define DPATH PREFIX #define SBINPATH PREFIX "/sbin/" #define BINPATH PREFIX "/bin/" #define MSGPATH DATADIR "/" PACKAGE "/messages" #define MODPATH LIBDIR "/" PACKAGE "/modules/" #define HPATH DATADIR "/" PACKAGE "/help" #define AUTOMODPATH MODPATH "/autoload/" #define ETCPATH SYSCONFDIR #define LOGPATH LOCALSTATEDIR "/log" #define RUNPATH LOCALSTATEDIR "/run" /* files */ #define SPATH SBINPATH "/ircd" /* ircd executable */ #define CPATH ETCPATH "/ircd.conf" /* ircd.conf file */ #define KPATH ETCPATH "/kline.db" /* kline file */ #define RESVPATH ETCPATH "/resv.db" /* resv file */ #define DLPATH ETCPATH "/dline.db" /* dline file */ #define XPATH ETCPATH "/xline.db" /* xline file */ #define GPATH ETCPATH "/gline.db" /* gline file */ #define MPATH ETCPATH "/ircd.motd" /* MOTD file */ #define LPATH LOGPATH "/ircd.log" /* ircd logfile */ #define PPATH RUNPATH "/ircd.pid" /* pid file */ #define LIPATH ETCPATH "/links.txt" /* cached links file */ /* * This file is included to supply default values for things which * are now configurable at runtime. */ #define HYBRID_SOMAXCONN 25 #define MAX_TDKLINE_TIME (24*60*360) /* tests show that about 7 fds are not registered by fdlist.c, these * include std* descriptors + some others (by OpenSSL etc.). Note this is * intentionally too high, we don't want to eat fds up to the last one */ #define LEAKED_FDS 10 /* how many (privileged) clients can exceed max_clients */ #define MAX_BUFFER 60 #define MAXCLIENTS_MAX (hard_fdlimit - LEAKED_FDS - MAX_BUFFER) #define MAXCLIENTS_MIN 32 /* class {} default values */ #define DEFAULT_SENDQ 9000000 /* default max SendQ */ #define DEFAULT_RECVQ 2560 /* default max RecvQ */ #define PORTNUM 6667 /* default outgoing portnum */ #define DEFAULT_PINGFREQUENCY 120 /* Default ping frequency */ #define DEFAULT_CONNECTFREQUENCY 600 /* Default connect frequency */ #define CLIENT_FLOOD_MAX 8000 #define CLIENT_FLOOD_MIN 512 #define WATCHSIZE_MIN 1 #define WATCHSIZE_DEFAULT 32 #define TS_MAX_DELTA_MIN 10 /* min value for ts_max_delta */ #define TS_MAX_DELTA_DEFAULT 600 /* default for ts_max_delta */ #define TS_WARN_DELTA_MIN 10 /* min value for ts_warn_delta */ #define TS_WARN_DELTA_DEFAULT 30 /* default for ts_warn_delta */ /* ServerInfo default values */ #define NETWORK_NAME_DEFAULT "EFnet" /* default for network_name */ #define NETWORK_DESC_DEFAULT "Eris Free Network" /* default for network_desc */ #define SERVICE_NAME_DEFAULT "service.someserver" #define GLINE_REQUEST_EXPIRE_DEFAULT 600 /* General defaults */ #define MAXIMUM_LINKS_DEFAULT 0 /* default for maximum_links */ #define LINKS_DELAY_DEFAULT 300 #define MAX_TARGETS_DEFAULT 4 /* default for max_targets */ #define CONNECTTIMEOUT 30 /* Recommended value: 30 */ #define IDENT_TIMEOUT 10 #define MIN_JOIN_LEAVE_TIME 60 #define MAX_JOIN_LEAVE_COUNT 25 #define OPER_SPAM_COUNTDOWN 5 #define JOIN_LEAVE_COUNT_EXPIRE_TIME 120 #define MIN_SPAM_NUM 5 #define MIN_SPAM_TIME 60 #endif /* INCLUDED_defaults_h */ ircd-hybrid-8.1.13.dfsg.1/include/patchlevel.h0000644000175000017500000000203412263053413017126 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * patchlevel.h: A header defining the patchlevel. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: patchlevel.h 2789 2014-01-07 19:33:24Z michael $ */ #ifndef PATCHLEVEL #define PATCHLEVEL "hybrid-8.1.13" #endif ircd-hybrid-8.1.13.dfsg.1/include/s_auth.h0000644000175000017500000000420012263053413016257 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_auth.h: A header for the ident functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_auth.h 2180 2013-06-04 10:55:19Z michael $ */ #ifndef INCLUDED_s_auth_h #define INCLUDED_s_auth_h /* * flag values for AuthRequest * NAMESPACE: AM_xxx - Authentication Module */ #define AM_DOING_AUTH 0x1 #define AM_DNS_PENDING 0x2 #define SetDNSPending(x) ((x)->flags |= AM_DNS_PENDING) #define ClearDNSPending(x) ((x)->flags &= ~AM_DNS_PENDING) #define IsDNSPending(x) ((x)->flags & AM_DNS_PENDING) #define SetDoingAuth(x) ((x)->flags |= AM_DOING_AUTH) #define ClearAuth(x) ((x)->flags &= ~AM_DOING_AUTH) #define IsDoingAuth(x) ((x)->flags & AM_DOING_AUTH) struct Client; struct AuthRequest { dlink_node node; /* auth_doing_list */ int flags; struct Client* client; /* pointer to client struct for request */ fde_t fd; /* file descriptor for auth queries */ time_t timeout; /* time when query expires */ }; extern void auth_init(void); extern void start_auth(struct Client *); extern void send_auth_query(struct AuthRequest *); extern void remove_auth_request(struct AuthRequest *); extern void delete_auth(struct AuthRequest *); extern void release_auth_client(struct AuthRequest *); #endif /* INCLUDED_s_auth_h */ ircd-hybrid-8.1.13.dfsg.1/include/conf_db.h0000644000175000017500000000665212263053413016403 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 1996-2009 by Andrew Church * Copyright (C) 2012 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file conf_db.h * \brief Includes file utilities for database handling * \version $Id: conf_db.h 1737 2013-01-14 17:37:55Z michael $ */ #ifndef DATAFILES_H #define DATAFILES_H struct dbFILE { char mode; /**< 'r' for reading, 'w' for writing */ FILE *fp; /**< The file pointer itself */ char filename[HYB_PATH_MAX + 1]; /**< Name of the database file */ char tempname[HYB_PATH_MAX + 1]; /**< Name of the temporary file (for writing) */ }; extern void check_file_version(struct dbFILE *); extern uint32_t get_file_version(struct dbFILE *); extern int write_file_version(struct dbFILE *, uint32_t); extern struct dbFILE *open_db(const char *, const char *, uint32_t); extern void restore_db(struct dbFILE *); /* Restore to state before open_db() */ extern int close_db(struct dbFILE *); extern void backup_databases(void); #define read_db(f,buf,len) (fread((buf),1,(len),(f)->fp)) #define write_db(f,buf,len) (fwrite((buf),1,(len),(f)->fp)) #define getc_db(f) (fgetc((f)->fp)) extern int read_uint8(uint8_t *, struct dbFILE *); extern int write_uint8(uint8_t, struct dbFILE *); extern int read_uint16(uint16_t *, struct dbFILE *); extern int write_uint16(uint16_t, struct dbFILE *); extern int read_uint32(uint32_t *, struct dbFILE *); extern int write_uint32(uint32_t, struct dbFILE *); extern int read_uint64(uint64_t *, struct dbFILE *); extern int write_uint64(uint64_t, struct dbFILE *); extern int read_ptr(void **, struct dbFILE *); extern int write_ptr(const void *, struct dbFILE *); extern int read_string(char **, struct dbFILE *); extern int write_string(const char *, struct dbFILE *); extern void load_kline_database(void); extern void save_kline_database(void); extern void load_dline_database(void); extern void save_dline_database(void); extern void load_gline_database(void); extern void save_gline_database(void); extern void load_xline_database(void); extern void save_xline_database(void); extern void load_resv_database(void); extern void save_resv_database(void); extern void save_all_databases(void *); #define read_buffer(buf,f) (read_db((f),(buf),sizeof(buf)) == sizeof(buf)) #define write_buffer(buf,f) (write_db((f),(buf),sizeof(buf)) == sizeof(buf)) #define read_buflen(buf,len,f) (read_db((f),(buf),(len)) == (len)) #define write_buflen(buf,len,f) (write_db((f),(buf),(len)) == (len)) #define read_variable(var,f) (read_db((f),&(var),sizeof(var)) == sizeof(var)) #define write_variable(var,f) (write_db((f),&(var),sizeof(var)) == sizeof(var)) #define DATABASE_UPDATE_TIMEOUT 300 #define KLINE_DB_VERSION 1 #endif ircd-hybrid-8.1.13.dfsg.1/include/ircd_signal.h0000644000175000017500000000213312263053413017255 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd_signal.h: A header for ircd signals. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd_signal.h 33 2005-10-02 20:50:00Z knight $ */ #ifndef INCLUDED_ircd_signal_h #define INCLUDED_ircd_signal_h extern void setup_signals(void); #endif /* INCLUDED_ircd_signal_h */ ircd-hybrid-8.1.13.dfsg.1/include/serno.h0000644000175000017500000000004212263053456016131 0ustar domdom#define SERIALNUM "20140107_2789" ircd-hybrid-8.1.13.dfsg.1/include/ircd_defs.h0000644000175000017500000000533412263053413016727 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd_defs.h: A header for ircd global definitions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd_defs.h 2365 2013-07-04 21:49:38Z michael $ */ /* * NOTE: NICKLEN and TOPICLEN do not live here anymore. Set it with configure * Otherwise there are no user servicable part here. * */ /* ircd_defs.h - Global size definitions for record entries used * througout ircd. Please think 3 times before adding anything to this * file. */ #ifndef INCLUDED_ircd_defs_h #define INCLUDED_ircd_defs_h #include "stdinc.h" /* Right out of the RFC */ #define IRCD_BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */ #define HOSTLEN 63 /* Length of hostname. Updated to comply with RFC 1123 */ #define NICKLEN 30 #define USERLEN 10 #define PORTNAMELEN 6 /* ":31337" */ #define HOSTIPLEN 45 /* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255") */ #define PASSWDLEN 128 #define IDLEN 12 /* this is the maximum length, not the actual generated length; DO NOT CHANGE! */ #define REALLEN 50 #define LOCAL_CHANNELLEN 50 #define CHANNELLEN 200 #define TOPICLEN 300 #define KILLLEN 180 #define REASONLEN 180 #define KICKLEN 180 #define AWAYLEN 180 #define KEYLEN 23 #define USERHOST_REPLYLEN (NICKLEN+HOSTLEN+USERLEN+5) #define MAX_DATE_STRING 32 /* maximum string length for a date string */ #define IRCD_MAXNS 3 /* Maximum number of nameservers in /etc/resolv.conf we care about */ #define LOWEST_SAFE_FD 4 /* skip stdin, stdout, stderr, and profiler */ /* This is to get around the fact that some implementations have ss_len and * others do not */ struct irc_ssaddr { struct sockaddr_storage ss; unsigned char ss_len; in_port_t ss_port; }; #endif /* INCLUDED_ircd_defs_h */ ircd-hybrid-8.1.13.dfsg.1/ltmain.sh0000755000175000017500000105152212263053414015036 0ustar domdom # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ircd-hybrid-8.1.13.dfsg.1/acinclude.m40000644000175000017500000001720312263053414015401 0ustar domdomdnl Inspired by work Copyright (C) 2006 Luca Filipozzi dnl vim: set fdm=marker sw=2 ts=2 et si: dnl {{{ ax_check_lib_ipv4 AC_DEFUN([AX_CHECK_LIB_IPV4],[ AC_CHECK_FUNC(getaddrinfo, [], AC_SEARCH_LIBS(getaddrinfo, nsl)) AC_CHECK_FUNC(getnameinfo, [], AC_SEARCH_LIBS(getnameinfo, nsl)) AC_SEARCH_LIBS([socket],[socket],,[AC_MSG_ERROR([socket library not found])]) AC_CHECK_TYPES([struct sockaddr_in, struct sockaddr_storage, struct addrinfo],,,[#include #include #include ]) AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,,[#include ]) ])dnl }}} dnl {{{ ax_check_lib_ipv6 AC_DEFUN([AX_CHECK_LIB_IPV6],[ AC_CHECK_TYPE([struct sockaddr_in6],[AC_DEFINE([IPV6],[1],[Define to 1 if you have IPv6 support.])],,[#include ]) ])dnl }}} dnl {{{ ax_arg_enable_ioloop_mechanism (FIXME) AC_DEFUN([AX_ARG_ENABLE_IOLOOP_MECHANISM],[ dnl {{{ allow the user to specify desired mechanism desired_iopoll_mechanism="none" dnl FIXME need to handle arguments a bit better (see ac_arg_disable_block_alloc) AC_ARG_ENABLE([kqueue], [AS_HELP_STRING([--enable-kqueue], [Force kqueue usage.])], [desired_iopoll_mechanism="kqueue"]) AC_ARG_ENABLE([epoll], [AS_HELP_STRING([--enable-epoll], [Force epoll usage.])], [desired_iopoll_mechanism="epoll"]) AC_ARG_ENABLE([devpoll],[AS_HELP_STRING([--enable-devpoll],[Force devpoll usage.])],[desired_iopoll_mechanism="devpoll"]) AC_ARG_ENABLE([poll], [AS_HELP_STRING([--enable-poll], [Force poll usage.])], [desired_iopoll_mechanism="poll"]) AC_ARG_ENABLE([select], [AS_HELP_STRING([--enable-select], [Force select usage.])], [desired_iopoll_mechanism="select"]) dnl }}} dnl {{{ preamble AC_MSG_CHECKING([for optimal/desired iopoll mechanism]) iopoll_mechanism_none=0 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_NONE],[$iopoll_mechanism_none],[no iopoll mechanism]) dnl }}} dnl {{{ check for kqueue mechanism support iopoll_mechanism_kqueue=1 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_KQUEUE],[$iopoll_mechanism_kqueue],[kqueue mechanism]) AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([kevent])],[is_kqueue_mechanism_available="yes"],[is_kqueue_mechanism_available="no"]) dnl }}} dnl {{{ check for epoll oechanism support iopoll_mechanism_epoll=2 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_EPOLL],[$iopoll_mechanism_epoll],[epoll mechanism]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY) #if !defined(__NR_epoll_create) #if defined(__ia64__) #define __NR_epoll_create 1243 #elif defined(__x86_64__) #define __NR_epoll_create 214 #elif defined(__sparc64__) || defined(__sparc__) #define __NR_epoll_create 193 #elif defined(__s390__) || defined(__m68k__) #define __NR_epoll_create 249 #elif defined(__ppc64__) || defined(__ppc__) #define __NR_epoll_create 236 #elif defined(__parisc__) || defined(__arm26__) || defined(__arm__) #define __NR_epoll_create 224 #elif defined(__alpha__) #define __NR_epoll_create 407 #elif defined(__sh64__) #define __NR_epoll_create 282 #elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__) #define __NR_epoll_create 254 #else #error No system call numbers defined for epoll family. #endif #endif _syscall1(int, epoll_create, int, size) #endif ]], [[ return epoll_create(256) == -1 ? 1 : 0 ]])], [is_epoll_mechanism_available="yes"],[is_epoll_mechanism_available="no"]) dnl }}} dnl {{{ check for devpoll mechanism support iopoll_mechanism_devpoll=3 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_DEVPOLL],[$iopoll_mechanism_devpoll],[devpoll mechanism]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ])],[is_devpoll_mechanism_available="yes"],[is_devpoll_mechanism_available="no"]) if test "$is_devpoll_mechanism_available" = "yes" ; then AC_DEFINE([HAVE_DEVPOLL_H],[1],[Define to 1 if you have the header file.]) fi AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ])],[is_devpoll_mechanism_available="yes"],[is_devpoll_mechanism_available="no"]) if test "$is_devpoll_mechanism_available" = "yes" ; then AC_DEFINE([HAVE_SYS_DEVPOLL_H],[1],[Define to 1 if you have the header file.]) fi dnl }}} dnl {{{ check for poll mechanism support iopoll_mechanism_poll=4 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_POLL],[$iopoll_mechanism_poll],[poll mechanism]) AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([poll])],[is_poll_mechanism_available="yes"],[is_poll_mechanism_available="no"]) dnl }}} dnl {{{ check for select mechanism support iopoll_mechanism_select=5 AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_SELECT],[$iopoll_mechanism_select],[select mechanism]) AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([select])],[is_select_mechanism_available="yes"],[is_select_mechanism_available="no"]) dnl }}} dnl {{{ determine the optimal mechanism optimal_iopoll_mechanism="none" for mechanism in "kqueue" "epoll" "devpoll" "poll" "select" ; do # order is important eval "is_optimal_iopoll_mechanism_available=\$is_${mechanism}_mechanism_available" if test "$is_optimal_iopoll_mechanism_available" = "yes" ; then optimal_iopoll_mechanism="$mechanism" break fi done dnl }}} dnl {{{ select between optimal mechanism and desired mechanism (if specified) if test "$desired_iopoll_mechanism" = "none" ; then if test "$optimal_iopoll_mechanism" = "none" ; then AC_MSG_RESULT([none]) AC_MSG_ERROR([no iopoll mechanism found!]) else selected_iopoll_mechanism=$optimal_iopoll_mechanism AC_MSG_RESULT([$selected_iopoll_mechanism]) fi else eval "is_desired_iopoll_mechanism_available=\$is_${desired_iopoll_mechanism}_mechanism_available" if test "$is_desired_iopoll_mechanism_available" = "yes" ; then selected_iopoll_mechanism=$desired_iopoll_mechanism AC_MSG_RESULT([$selected_iopoll_mechanism]) else AC_MSG_RESULT([none]) AC_MSG_ERROR([desired iopoll mechanism, $desired_iopoll_mechanism, is not available]) fi fi dnl }}} dnl {{{ postamble eval "use_iopoll_mechanism=\$iopoll_mechanism_${selected_iopoll_mechanism}" AC_DEFINE_UNQUOTED([USE_IOPOLL_MECHANISM],[$use_iopoll_mechanism],[use this iopoll mechanism]) dnl }}} ])dnl }}} dnl {{{ ax_arg_enable_halfops AC_DEFUN([AX_ARG_ENABLE_HALFOPS],[ AC_ARG_ENABLE([halfops],[AS_HELP_STRING([--enable-halfops],[Enable halfops support.])],[halfops="$enableval"],[halfops="no"]) if test "$halfops" = "yes" ; then AC_DEFINE([HALFOPS],[1],[Define to 1 if you want halfops support.]) fi ])dnl }}} dnl {{{ ax_arg_enable_debugging AC_DEFUN([AX_ARG_ENABLE_DEBUGGING],[ AC_ARG_ENABLE([debugging],[AS_HELP_STRING([--enable-debugging],[Enable debugging.])],[debugging="$enableval"],[debugging="no"]) if test "$debugging" = "yes" ; then CFLAGS="-Wall -g -O0" fi ])dnl }}} dnl {{{ ax_arg_enable_warnings AC_DEFUN([AX_ARG_ENABLE_WARNINGS],[ AC_ARG_ENABLE([warnings],[AS_HELP_STRING([--enable-warnings],[Enable compiler warnings.])],[warnings="$enableval"],[warnings="no"]) if test "$warnings" = "yes" ; then AX_APPEND_COMPILE_FLAGS([-Wall]) AX_APPEND_COMPILE_FLAGS([-Wextra]) AX_APPEND_COMPILE_FLAGS([-Wno-unused]) AX_APPEND_COMPILE_FLAGS([-Wcast-qual]) AX_APPEND_COMPILE_FLAGS([-Wcast-align]) AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast]) AX_APPEND_COMPILE_FLAGS([-Wmissing-declarations]) AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes]) AX_APPEND_COMPILE_FLAGS([-Wnested-externs]) AX_APPEND_COMPILE_FLAGS([-Wredundant-decls]) AX_APPEND_COMPILE_FLAGS([-Wshadow]) AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_APPEND_COMPILE_FLAGS([-Wundef]) fi ])dnl }}} ]) dnl }}} ircd-hybrid-8.1.13.dfsg.1/missing0000755000175000017500000001533012263053414014606 0ustar domdom#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ircd-hybrid-8.1.13.dfsg.1/NEWS0000644000175000017500000004042112263053414013705 0ustar domdom-- ircd-hybrid-8.1.13 Release Notes o) Fixed EOB not working for remote servers (resulted in fake direction notices) o) Fixed remote client connection notices for servers that are more than one hop away o) Fixed bug where ircd didn't timeout SSL connections that haven't finished the SSL handshake o) Fixed several bugs with server hiding o) Updated/fixed help files o) WHOIS no longer sends a notice to +y operators -- ircd-hybrid-8.1.12 Release Notes o) RPL_WHOISMODES now uses the 379 numeric o) Serial number is now shown on start up o) Fixed possible channel mode desynch with services o) Fixed TS 6 support with LOCOPS o) Minor code cleanups o) Fixed file descriptor leak with empty help files o) Fixed issue with WEBIRC where hostnames were not validated -- ircd-hybrid-8.1.11 Release Notes o) Administrators may now see channel modes in /LIST o) Fixed compile error on BSD systems when building with kqueue() -- ircd-hybrid-8.1.10 Release Notes o) Fixed bug with kqueue() where it occasionally dropped updates o) Changed WHOIS to show a client's certificate fingerprint to administrators only o) The WHO reply now shows whether or not a nickname has been registered with NickServ. ('r' status flag) o) Fixed some flaws with server hiding o) Fixed bug where "STATS P" would leak ip addresses to remotely connected administrators, even if serverhide::hide_server_ips was set to 'yes' o) Services coders: added SVSKILL -- ircd-hybrid-8.1.9 Release Notes o) Added usermode +W. Users connected via a webirc gateway get this mode set by servers. o) /WHOIS now shows if a client is connected via a webirc gateway o) Administrators may now see +s channels a user is in with /WHOIS. Secret channels are prepended with a tilde in the /WHOIS reply. o) Administrators are now able to see all the user modes a user has set via /whois -- ircd-hybrid-8.1.8 Release Notes o) Fixed bug that would lead to a desynchronized nick database throughout the entire network if using services enforced nick names (SVSNICK) o) Cleaned up/modernized build system o) Add -fstack-protector to CFLAGS if available. Basically checks for buffer overflows/stack-smashing attacks o) When using anope 1.9/2.0 services, /WHOIS now shows the account name of a registered/identified client (numeric 330) o) Administrators can now see +s channels in /LIST -- ircd-hybrid-8.1.7 Release Notes o) Fixed issue with channel mode +n having no functionality at all o) Fixed SSL certificate fingerprint validation for outgoing server connects o) Updated several documentation files -- ircd-hybrid-8.1.6 Release Notes o) Fixed possible core with empty motd files -- ircd-hybrid-8.1.5 Release Notes o) Fixed bug that would prevent servers from linking together if connect::aftype isn't set -- ircd-hybrid-8.1.4 Release Notes o) Added 'xline' and 'resv' logging types. See doc/reference.conf for more information o) Fixed bug where remote /STATS requests were not rate limited o) Fixed core with empty auth::spoof entries o) Increased oper/auth/connect password length limit from 20 to 128 o) Minor fixes to nickflood control code -- ircd-hybrid-8.1.3 Release Notes o) Fixed possible core on "STATS z" o) Revised doc/reference.conf o) Fixed broken --disable-libgeoip switch -- ircd-hybrid-8.1.2 Release Notes o) Added general::cycle_on_host_change configuration option o) Added general::stats_u_oper_only configuration option o) Added support for SHA-256 ssl certificate fingerprint based operator{} and connect{} blocks. In conjunction with Anope 1.9/2.0 IRC-services, clients are now also able to automatically identify for their nick with ssl certificate fingerprints o) Added operator::ssl_connection_required configuration option. See doc/reference.conf for more information o) Added usermode +S (client is connected via SSL/TLS). Allows services to keep track of what users are connected via SSL, and allows to see ssl-status of remote clients in a /whois o) Fixed a server name leak with server hiding enabled. Reported by Adam -- ircd-hybrid-8.1.1 Release Notes ######################################################################## o) IMPORTANT: moved disable_remote_command configuration directive from general{} block to serverhide{} block ######################################################################## o) Minor code cleanups/performance improvements o) Fixed bug where opers could see LOCOPS messages even if they don't have the +l mode set o) Fixed bug where non-SSL clients could join +S channels on non-SSL servers o) Implemented motd{} configuration blocks. See doc/reference.conf for more information o) "STATS T" shows configured MOTD files -- ircd-hybrid-8.1.0 Release Notes o) Minor code cleanups/performance improvements -- ircd-hybrid-8.1.0rc1 Release Notes o) Fixed broken spoofs -- ircd-hybrid-8.1.0beta5 Release Notes o) Removed 'remote', and 'global_kill' oper flags, and added 'connect', 'squit', and 'kill' flags for better fine-tuning instead. Whether or not a specific action is allowed on a remote server can be controlled by appending the ':remote' flag. For example: 'kill' allows only local clients to be killed, whereas 'kill:remote' allows to issue a KILL for remote clients o) Added 'locops' and 'wallops' to irc-operator flags o) Improve/cleanup HELP system -- ircd-hybrid-8.1.0beta4 Release Notes o) Implemented channel mode +M. Clients that haven't identified their name with NickServ may not speak in a channel that has this mode set o) Fixed weird idletimes shown in /trace o) Added 'nononreg' (+R) to general::oper_umodes o) Added user mode +F (can see remote client connect/exit notices) -- ircd-hybrid-8.1.0beta3 Release Notes o) PCRE support has been dropped o) "STATS o" now shows how many times an oper{} block has been used. Similar to STATS x|q" o) Implemented channel mode +c. Known from other ircds, this mode basically prevents users from sending messages including control codes to a channel that has this mode set o) Fixed bug where bans were not checked against non-channel members when sending messages to a channel o) Removed channel::quiet_on_ban configuration option. This feature is now enabled by default -- ircd-hybrid-8.1.0beta2 Release Notes o) Fixed broken compile with libGeoIP disabled o) Code cleanups; working towards stabilization and improved performance o) Removed operflag 'nick_changes'. Operators can now set +n at will o) Fixed shared{} blocks not working as expected o) Fixed spoofs not working as expected -- ircd-hybrid-8.1.0beta1 Release Notes ######################################################################## o) IMPORTANT: name/channel entries can't be stacked any longer within a single resv{} block. Each entry now requires its own resv{} block. Read doc/reference.conf for more details ####################################################################### o) Added resv::exempt configuration option. Exempt can be either a ISO 3166 alpha-2 two letter country code, or a nick!user@host mask. CIDR is supported o) Removed channel::restrict_channels configuration option o) Preliminary libGeoIP support. Currently only used for exempt entries in resv{} blocks o) Improved WEBIRC authentication; added 'webirc' to auth::flags. A "webirc." spoof is now no longer required o) Implemented new memory pool allocator which basically is based upon Tor's mempool allocator for Tor cells o) Major code cleanups o) Implemented new binary database storage for X-,D-,K-,G-Lines and RESVs. Temporary bans are now stored as well and will persist after a reboot o) Channel based resv{} blocks may now contain wildcards o) NICK/JOIN now shows the actual reason of reserved nick-/channelnames o) contrib/ and its content has been removed from the tree o) Added serverhide::hide_services configuration option o) Added 'nononreg' (+R) to oper::umodes and general::oper_only_modes o) Added support for "away-notify" client capability -- ircd-hybrid-8.0.9 Release Notes o) Fixed bug where ircd would sometimes drop a services link because of a missing argument to the SVSMODE command o) Fixed weird idletimes shown in /trace -- ircd-hybrid-8.0.8 Release Notes o) "STATS s" now shows configured services{} blocks as well o) Fixed compile warnings, minor code cleanups and optimizations o) Increased nickname history length to 32768 o) Unidentified/unregistered nicks may not speak in +R channels -- ircd-hybrid-8.0.7 Release Notes o) Services may now set a channel topic without joining the channel first o) Fixed bug where /whois would send empty sockhost information on TS5 servers o) Remote server connection and split notices now go to new usermode +e. These previously used usermode +x. o) Services may now change the host of a specific user via "SVSMODE +x " -- ircd-hybrid-8.0.6 Release Notes o) Fix bug where idle time sometimes is 0 even if the client didn't send any private message o) Fixed possible core in try_parse_v4_netmask() -- ircd-hybrid-8.0.5 Release Notes ######################################################################## o) IMPORTANT: nick and topic lengths are now configurable via ircd.conf. A max_nick_length, as well as a max_topic_length configuration option can now be found in the serverinfo{} block ######################################################################## o) Fixed build on GNU/Hurd as reported by Dominic Hargreaves o) Fixed log files not getting reopened after /rehash o) Improved logging of configuration file issues o) ircd.pid has been accidentally saved in /var instead of /var/run o) Linux RT signal support for notification of socket events has been dropped o) Fixed "STATS Y|y" sometimes sending weird sendq/recvq values o) INFO now also shows configured values of 'disable_fake_channels', and 'stats_e_disabled' o) m_webirc.c is now officially supported, and has been moved from contrib/ to modules/ o) /whois, /stats p, and /trace may now show fake idle times depending on how the new class::min_idle and class::max_idle configuration directives have been configured. This feature basically works in the same way as it does in csircd o) The configuration parser now does support 'year' and 'month' units -- ircd-hybrid-8.0.4 Release Notes o) Fixed possible core on USERHOST/ISON with optimization enabled o) Fixed bug where can_flood sometimes didn't work as expected -- ircd-hybrid-8.0.3 Release Notes o) Fixed core on UNDLINE o) XLINE/KLINE/RESV/DLINE/SQUIT and KILL now have the same default reason if a reason hasn't been specified -- ircd-hybrid-8.0.2 Release Notes o) Minor updates to the build system o) Fixed broken --enable-assert configure switch o) Fixed bug where timed events stopped from working if the system's clock is running backwards o) STATS q|Q now shows how many times a resv{} block has been matched o) Fixed contributed WEBIRC module o) IRC operators may now again see server generated nick rejection notices -- ircd-hybrid-8.0.1 Release Notes o) Fixed broken CIDR support for CHALLENGE based irc operator logins o) Fixed class limits not properly applying to oper{} blocks o) Fixed possible TBURST desynchronization with services o) Fixed TBURST sending server's name to clients if it's a hidden server -- ircd-hybrid-8.0.0 Release Notes o) Fixed an off-by-one with spoofs. Spoofs are now also checked for invalid characters o) Removed general::use_whois_actually configuration directive. This is now enabled by default o) Minor SQUIT handling fixes o) Fixed bancache not being updated on CHGHOST/CHGIDENT -- ircd-hybrid-8rc1 Release Notes o) Removed general::client_flood configuration option and added the new 'recvq' configuration directive to class{} blocks. The max size of a receive queue can be seen in "STATS Y" for each class o) Allow the '[' and ']' characters in server description -- ircd-hybrid-8beta3 Release Notes o) Fixed wrong syntax in several language files o) Removed &localchannels o) PRIVMSG to opers@some.server is no longer supported o) Fixed bug that could lead to topic desynchronization o) Removed serverhide::disable_hidden configuration option o) Dropped ircd-hybrid-6 GLINE compatibility mode o) Removed use_invex, use_except and use_knock configuration options. These features are now enabled by default -- ircd-hybrid-8beta2 Release Notes o) channel::disable_fake_channels now also disables ascii 29 (mIRC italic) when set to yes o) Added channel::max_chans_per_oper configuration directive. The old way was to let operators join three times the amount of max_chans_per_user o) Replaced MODLOAD, MODUNLOAD, MODRELOAD, MODLIST and MODRESTART commands with the new MODULE command which can be fed with the LOAD, UNLOAD, RELOAD and LIST parameters. MODRESTART has been entirely removed. Use "MODULE RELOAD *" to reload all modules o) Added back server notice when a client tries to obtain a reserved nick name o) Removed OMOTD module o) Added 'set' to operator privilege flags. Gives access to the "SET" command o) Improved TS6 support o) Channel keys/passwords are now case sensitive -- ircd-hybrid-8beta1 Release Notes o) Implemented full services support, including but not limited to the following changes: - Added SVSNICK, and SVSMODE command handlers - Added service stamps to NICK/UID messages - Added SVS to server capabilities (CAPAB). SVS capable servers can deal with extended NICK/UID messages that contain service IDs/stamps. - Changed rejected client notices to go to new usermode +j. These previously used usermode +r. - Added usermode +r (registered nick) and channelmode +r (registered channel) - Added usermode +R (only registered clients may send a private message) - Added channelmode +R (only registered clients may join that channel) - Various services shortcuts have been added (/NS, /CS, /NICKSERV, /CHANSERV, etc.) - Added services{} block to ircd.conf - Added services_name directive to general{} block - Added GLOBOPS mainly for services compatibility, but can be used by operators, too o) Removed RKLINE and RXLINE commands. Regular expression based bans should only be added via ircd.conf o) Added 'globops', 'restart', 'dline', 'undline' and 'module' operator privilege flags. Read doc/reference.conf for further explanation of what these flags control o) Removed Idle-time klines o) Cleaned up modules API. Old modules won't work anymore o) Removed general::burst_away configuration directive. AWAY bursts are now controlled via connect::flags explicitly o) Introduced new logging subsystem including log rotation based on file sizes. Log timestamp format is ISO8601 now o) Added support for remote D-lines o) Added usermode +H which is basically a replacement for the hidden_admin and hidden_oper operator flags. With usermode +H, irc operator status can now be hidden even on remote servers o) Added CIDR support for operator{} blocks o) Removed the servlink program. ircd-hybrid can now make use of SSL/TLS for inter-server communication. NOTE: compressed server links are of course still available, but a SSL/TLS connection is required, as compression is now handled via OpenSSL o) Removed 'ssl_server_protocol' configuration directive and added 'ssl_client_method' and 'ssl_server_method' instead. Both of these options can now be changed at runtime o) Oper login IDs are no longer limited to NICKLEN*2 o) Removed channel::burst_topicwho configuration option. Topicsetters are now sent by default o) "STATS Y|y" now reports CIDR limits as well o) Added m_webirc.c to contrib/ o) Overall code cleanup and speed improvements -------------------------------------------------------------------------------- BUG REPORTS: If you run this code and encounter problems, you must report the bug by EMAIL to bugs@ircd-hybrid.org Please include a gdb backtrace and a copy of your config.h and ircd.conf with any report (with passwords and other sensitive information masked). DISCUSSION: There is a mailing list for discussion of hybrid issues, including betas. To subscribe, use this link: https://lists.ircd-hybrid.org/mailman/listinfo/hybrid This is the proper place to discuss new features, bugs, etc. Questions/comments directed to bugs@ircd-hybrid.org Other files recommended for reading: README, INSTALL -------------------------------------------------------------------------------- $Id: NEWS 2782 2014-01-06 17:53:59Z michael $ ircd-hybrid-8.1.13.dfsg.1/configure0000755000175000017500000176124112263053414015130 0ustar domdom#! /bin/sh # From configure.ac Id: configure.ac 2703 2013-12-20 17:58:49Z michael . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for ircd-hybrid 8.1.13. # # 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 -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || 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: bugs@ircd-hybrid.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: 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'" lt_ltdl_dir='libltdl' SHELL=${CONFIG_SHELL-/bin/sh} 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='ircd-hybrid' PACKAGE_TARNAME='ircd-hybrid' PACKAGE_VERSION='8.1.13' PACKAGE_STRING='ircd-hybrid 8.1.13' PACKAGE_BUGREPORT='bugs@ircd-hybrid.org' PACKAGE_URL='' ac_unique_file="src/ircd.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_func_list= ac_header_list= ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LOCALSTATEDIR DATADIR LIBDIR SYSCONFDIR PREFIX ENABLE_SSL_FALSE ENABLE_SSL_TRUE LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL LEXLIB LEX_OUTPUT_ROOT LEX YFLAGS YACC am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install enable_libgeoip enable_openssl enable_assert enable_kqueue enable_epoll enable_devpoll enable_poll enable_select enable_halfops enable_debugging enable_warnings ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS 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 ircd-hybrid 8.1.13 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/ircd-hybrid] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ircd-hybrid 8.1.13:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl --disable-libgeoip Disable GeoIP support --enable-openssl=DIR Enable OpenSSL support (DIR optional). --disable-openssl Disable OpenSSL support. --enable-assert Enable assert() statements --enable-kqueue Force kqueue usage. --enable-epoll Force epoll usage. --enable-devpoll Force devpoll usage. --enable-poll Force poll usage. --enable-select Force select usage. --enable-halfops Enable halfops support. --enable-debugging Enable debugging. --enable-warnings Enable compiler warnings. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR 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 YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. 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 . _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 ircd-hybrid configure 8.1.13 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_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || 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_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_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_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 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _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_decl # 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_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $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_member # 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 bugs@ircd-hybrid.org ## ## ----------------------------------- ##" ) | 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 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 ircd-hybrid $as_me 8.1.13, 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 if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_func_list " strtok_r" as_fn_append ac_func_list " usleep" as_fn_append ac_func_list " strlcat" as_fn_append ac_func_list " strlcpy" as_fn_append ac_header_list " crypt.h" as_fn_append ac_header_list " sys/resource.h" as_fn_append ac_header_list " sys/param.h" as_fn_append ac_header_list " types.h" as_fn_append ac_header_list " socket.h" as_fn_append ac_header_list " sys/wait.h" as_fn_append ac_header_list " wait.h" # 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 am__api_version='1.14' 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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${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 rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ircd-hybrid' VERSION='8.1.13' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers config.h" # Checks for programs. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 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 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 $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi if test "$ac_cv_prog_cc_c99" = "no"; then : as_fn_error $? "no suitable C99 compiler found. Aborting." "$LINENO" 5 fi for ac_prog in 'bison -y' byacc 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_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex 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_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi # Initializing libtool. case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # 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 # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${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 fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${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 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 # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= 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 LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" 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 _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify 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 else ARGZ_H=argz.h; _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test "${with_included_ltdl+set}" = set; then : withval=$with_included_ltdl; fi if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes; then : ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $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 lt_dladvise_preload (); int main () { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else ac_cv_lib_ltdl_lt_dladvise_preload=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_ltdl_lt_dladvise_preload" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : with_included_ltdl=no else with_included_ltdl=yes fi else with_included_ltdl=yes fi else with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test "${with_ltdl_include+set}" = set; then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test "${with_ltdl_lib+set}" = set; then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. $as_echo "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 $as_echo_n "checking where to find libltdl headers... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 $as_echo "$LTDLINCL" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 $as_echo_n "checking where to find libltdl library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 $as_echo "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.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_func in closedir opendir readdir 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 else _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy 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 else _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: LIBTOOL="$LIBTOOL --silent" # Checks for libraries. if test "X$CC" != "X"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fstack-protector" >&5 $as_echo_n "checking whether ${CC} accepts -fstack-protector... " >&6; } if ${ssp_cv_cc+:} false; then : $as_echo_n "(cached) " >&6 else ssp_old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fstack-protector" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ssp_cv_cc=yes else ssp_cv_cc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ssp_old_cflags" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ssp_cv_cc" >&5 $as_echo "$ssp_cv_cc" >&6; } if test $ssp_cv_cc = yes; then CFLAGS="$CFLAGS -fstack-protector" $as_echo "#define ENABLE_SSP_CC 1" >>confdefs.h fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts " >&5 $as_echo_n "checking whether C compiler accepts ... " >&6; } if ${ax_cv_check_cflags__+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags__=yes else ax_cv_check_cflags__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__" >&5 $as_echo "$ax_cv_check_cflags__" >&6; } if test x"$ax_cv_check_cflags__" = xyes; then : : else : fi if ${CFLAGS+:} false; then : case " $CFLAGS " in *" "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains "; } >&5 (: CFLAGS already contains ) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \""; } >&5 (: CFLAGS="$CFLAGS ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS " ;; esac else CFLAGS="" fi for flag in -fno-strict-aliasing; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" if test "x$ac_cv_func_getaddrinfo" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" if test "x$ac_cv_func_getnameinfo" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getnameinfo" >&5 $as_echo_n "checking for library containing getnameinfo... " >&6; } if ${ac_cv_search_getnameinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getnameinfo (); int main () { return getnameinfo (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getnameinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getnameinfo+:} false; then : break fi done if ${ac_cv_search_getnameinfo+:} false; then : else ac_cv_search_getnameinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getnameinfo" >&5 $as_echo "$ac_cv_search_getnameinfo" >&6; } ac_res=$ac_cv_search_getnameinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "socket library not found" "$LINENO" 5 fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in" "ac_cv_type_struct_sockaddr_in" "#include #include #include " if test "x$ac_cv_type_struct_sockaddr_in" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_IN 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include #include #include " if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_STORAGE 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "#include #include #include " if test "x$ac_cv_type_struct_addrinfo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_ADDRINFO 1 _ACEOF fi ac_fn_c_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" "#include " if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#include " if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then : $as_echo "#define IPV6 1" >>confdefs.h fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # Checks for library functions. for ac_func in $ac_func_list 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 # Checks for header files. for ac_header in $ac_header_list 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 $as_echo_n "checking for library containing crypt... " >&6; } if ${ac_cv_search_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF for ac_lib in '' crypt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_crypt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_crypt+:} false; then : break fi done if ${ac_cv_search_crypt+:} false; then : else ac_cv_search_crypt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 $as_echo "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Check whether --enable-libgeoip was given. if test "${enable_libgeoip+set}" = set; then : enableval=$enable_libgeoip; else ac_fn_c_check_header_mongrel "$LINENO" "GeoIP.h" "ac_cv_header_GeoIP_h" "$ac_includes_default" if test "x$ac_cv_header_GeoIP_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing GeoIP_id_by_ipnum_v6_gl" >&5 $as_echo_n "checking for library containing GeoIP_id_by_ipnum_v6_gl... " >&6; } if ${ac_cv_search_GeoIP_id_by_ipnum_v6_gl+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char GeoIP_id_by_ipnum_v6_gl (); int main () { return GeoIP_id_by_ipnum_v6_gl (); ; return 0; } _ACEOF for ac_lib in '' GeoIP; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_GeoIP_id_by_ipnum_v6_gl=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_GeoIP_id_by_ipnum_v6_gl+:} false; then : break fi done if ${ac_cv_search_GeoIP_id_by_ipnum_v6_gl+:} false; then : else ac_cv_search_GeoIP_id_by_ipnum_v6_gl=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_GeoIP_id_by_ipnum_v6_gl" >&5 $as_echo "$ac_cv_search_GeoIP_id_by_ipnum_v6_gl" >&6; } ac_res=$ac_cv_search_GeoIP_id_by_ipnum_v6_gl if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBGEOIP 1" >>confdefs.h fi fi fi # Check whether --enable-openssl was given. if test "${enable_openssl+set}" = set; then : enableval=$enable_openssl; cf_enable_openssl=$enableval else cf_enable_openssl="auto" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL" >&5 $as_echo_n "checking for OpenSSL... " >&6; } if test "$cf_enable_openssl" != "no"; then cf_openssl_basedir="" if test "$cf_enable_openssl" != "auto" && test "$cf_enable_openssl" != "yes"; then cf_openssl_basedir="${cf_enable_openssl}" else for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\ /opt /opt/openssl /usr/local/openssl; do if test -f "${dirs}/include/openssl/opensslv.h"; then cf_openssl_basedir="${dirs}" break fi done unset dirs fi if test ! -z "$cf_openssl_basedir"; then if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS" LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS" else cf_openssl_basedir="" fi else if test -f "/usr/include/openssl/opensslv.h"; then cf_openssl_basedir="/usr" fi fi if test ! -z "$cf_openssl_basedir"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cf_openssl_basedir" >&5 $as_echo "$cf_openssl_basedir" >&6; } cf_enable_openssl="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found. Please check your path." >&5 $as_echo "not found. Please check your path." >&6; } cf_enable_openssl="no" fi unset cf_openssl_basedir else { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } fi if test "$cf_enable_openssl" != "no"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL 0.9.8 or above" >&5 $as_echo_n "checking for OpenSSL 0.9.8 or above... " >&6; } if test "$cross_compiling" = yes; then : cf_openssl_version_ok=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : cf_openssl_version_ok=yes else cf_openssl_version_ok=no 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 "$cf_openssl_version_ok" = "yes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RSA_free in -lcrypto" >&5 $as_echo_n "checking for RSA_free in -lcrypto... " >&6; } if ${ac_cv_lib_crypto_RSA_free+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $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 RSA_free (); int main () { return RSA_free (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypto_RSA_free=yes else ac_cv_lib_crypto_RSA_free=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_crypto_RSA_free" >&5 $as_echo "$ac_cv_lib_crypto_RSA_free" >&6; } if test "x$ac_cv_lib_crypto_RSA_free" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" fi if test "$ac_cv_lib_crypto_RSA_free" = "yes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_connect in -lssl" >&5 $as_echo_n "checking for SSL_connect in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $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 SSL_connect (); int main () { return SSL_connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_connect=yes else ac_cv_lib_ssl_SSL_connect=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_ssl_SSL_connect" >&5 $as_echo "$ac_cv_lib_ssl_SSL_connect" >&6; } if test "x$ac_cv_lib_ssl_SSL_connect" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSSL 1 _ACEOF LIBS="-lssl $LIBS" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - OpenSSL support disabled" >&5 $as_echo "no - OpenSSL support disabled" >&6; } cf_enable_openssl="no" fi fi if test "$ac_cv_lib_ssl_SSL_connect" = yes; then ENABLE_SSL_TRUE= ENABLE_SSL_FALSE='#' else ENABLE_SSL_TRUE='#' ENABLE_SSL_FALSE= fi # Check whether --enable-assert was given. if test "${enable_assert+set}" = set; then : enableval=$enable_assert; assert=$enableval else assert=no fi if test "$assert" = "no"; then : $as_echo "#define NDEBUG 1" >>confdefs.h fi $as_echo "#define NICKNAMEHISTORYLENGTH 32768" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_CHANNEL 1024*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_MEMBER 2048*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_BAN 1024*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_CLIENT 1024*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_LCLIENT 512*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_DNODE 32*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_DBUF 512*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_AUTH 128*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_DNS 64*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_WATCH 8*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_NAMEHOST 64*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_USERHOST 128*1024" >>confdefs.h $as_echo "#define MP_CHUNK_SIZE_IP_ENTRY 128*1024" >>confdefs.h # Argument processing. desired_iopoll_mechanism="none" # Check whether --enable-kqueue was given. if test "${enable_kqueue+set}" = set; then : enableval=$enable_kqueue; desired_iopoll_mechanism="kqueue" fi # Check whether --enable-epoll was given. if test "${enable_epoll+set}" = set; then : enableval=$enable_epoll; desired_iopoll_mechanism="epoll" fi # Check whether --enable-devpoll was given. if test "${enable_devpoll+set}" = set; then : enableval=$enable_devpoll; desired_iopoll_mechanism="devpoll" fi # Check whether --enable-poll was given. if test "${enable_poll+set}" = set; then : enableval=$enable_poll; desired_iopoll_mechanism="poll" fi # Check whether --enable-select was given. if test "${enable_select+set}" = set; then : enableval=$enable_select; desired_iopoll_mechanism="select" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optimal/desired iopoll mechanism" >&5 $as_echo_n "checking for optimal/desired iopoll mechanism... " >&6; } iopoll_mechanism_none=0 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_NONE $iopoll_mechanism_none _ACEOF iopoll_mechanism_kqueue=1 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_KQUEUE $iopoll_mechanism_kqueue _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define kevent to an innocuous variant, in case declares kevent. For example, HP-UX 11i declares gettimeofday. */ #define kevent innocuous_kevent /* System header to define __stub macros and hopefully few prototypes, which can conflict with char kevent (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef kevent /* 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 kevent (); /* 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_kevent || defined __stub___kevent choke me #endif int main () { return kevent (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : is_kqueue_mechanism_available="yes" else is_kqueue_mechanism_available="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext iopoll_mechanism_epoll=2 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_EPOLL $iopoll_mechanism_epoll _ACEOF 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 #if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY) #if !defined(__NR_epoll_create) #if defined(__ia64__) #define __NR_epoll_create 1243 #elif defined(__x86_64__) #define __NR_epoll_create 214 #elif defined(__sparc64__) || defined(__sparc__) #define __NR_epoll_create 193 #elif defined(__s390__) || defined(__m68k__) #define __NR_epoll_create 249 #elif defined(__ppc64__) || defined(__ppc__) #define __NR_epoll_create 236 #elif defined(__parisc__) || defined(__arm26__) || defined(__arm__) #define __NR_epoll_create 224 #elif defined(__alpha__) #define __NR_epoll_create 407 #elif defined(__sh64__) #define __NR_epoll_create 282 #elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__) #define __NR_epoll_create 254 #else #error No system call numbers defined for epoll family. #endif #endif _syscall1(int, epoll_create, int, size) #endif int main () { return epoll_create(256) == -1 ? 1 : 0 ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : is_epoll_mechanism_available="yes" else is_epoll_mechanism_available="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi iopoll_mechanism_devpoll=3 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_DEVPOLL $iopoll_mechanism_devpoll _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : is_devpoll_mechanism_available="yes" else is_devpoll_mechanism_available="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$is_devpoll_mechanism_available" = "yes" ; then $as_echo "#define HAVE_DEVPOLL_H 1" >>confdefs.h fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : is_devpoll_mechanism_available="yes" else is_devpoll_mechanism_available="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$is_devpoll_mechanism_available" = "yes" ; then $as_echo "#define HAVE_SYS_DEVPOLL_H 1" >>confdefs.h fi iopoll_mechanism_poll=4 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_POLL $iopoll_mechanism_poll _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define poll to an innocuous variant, in case declares poll. For example, HP-UX 11i declares gettimeofday. */ #define poll innocuous_poll /* System header to define __stub macros and hopefully few prototypes, which can conflict with char poll (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef poll /* 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 poll (); /* 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_poll || defined __stub___poll choke me #endif int main () { return poll (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : is_poll_mechanism_available="yes" else is_poll_mechanism_available="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext iopoll_mechanism_select=5 cat >>confdefs.h <<_ACEOF #define __IOPOLL_MECHANISM_SELECT $iopoll_mechanism_select _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define select to an innocuous variant, in case declares select. For example, HP-UX 11i declares gettimeofday. */ #define select innocuous_select /* System header to define __stub macros and hopefully few prototypes, which can conflict with char select (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef select /* 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 select (); /* 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_select || defined __stub___select choke me #endif int main () { return select (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : is_select_mechanism_available="yes" else is_select_mechanism_available="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext optimal_iopoll_mechanism="none" for mechanism in "kqueue" "epoll" "devpoll" "poll" "select" ; do # order is important eval "is_optimal_iopoll_mechanism_available=\$is_${mechanism}_mechanism_available" if test "$is_optimal_iopoll_mechanism_available" = "yes" ; then optimal_iopoll_mechanism="$mechanism" break fi done if test "$desired_iopoll_mechanism" = "none" ; then if test "$optimal_iopoll_mechanism" = "none" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } as_fn_error $? "no iopoll mechanism found!" "$LINENO" 5 else selected_iopoll_mechanism=$optimal_iopoll_mechanism { $as_echo "$as_me:${as_lineno-$LINENO}: result: $selected_iopoll_mechanism" >&5 $as_echo "$selected_iopoll_mechanism" >&6; } fi else eval "is_desired_iopoll_mechanism_available=\$is_${desired_iopoll_mechanism}_mechanism_available" if test "$is_desired_iopoll_mechanism_available" = "yes" ; then selected_iopoll_mechanism=$desired_iopoll_mechanism { $as_echo "$as_me:${as_lineno-$LINENO}: result: $selected_iopoll_mechanism" >&5 $as_echo "$selected_iopoll_mechanism" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } as_fn_error $? "desired iopoll mechanism, $desired_iopoll_mechanism, is not available" "$LINENO" 5 fi fi eval "use_iopoll_mechanism=\$iopoll_mechanism_${selected_iopoll_mechanism}" cat >>confdefs.h <<_ACEOF #define USE_IOPOLL_MECHANISM $use_iopoll_mechanism _ACEOF # Check whether --enable-halfops was given. if test "${enable_halfops+set}" = set; then : enableval=$enable_halfops; halfops="$enableval" else halfops="no" fi if test "$halfops" = "yes" ; then $as_echo "#define HALFOPS 1" >>confdefs.h fi # Check whether --enable-debugging was given. if test "${enable_debugging+set}" = set; then : enableval=$enable_debugging; debugging="$enableval" else debugging="no" fi if test "$debugging" = "yes" ; then CFLAGS="-Wall -g -O0" fi # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : enableval=$enable_warnings; warnings="$enableval" else warnings="no" fi if test "$warnings" = "yes" ; then for flag in -Wall; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wextra; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wno-unused; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wcast-qual; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wcast-align; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wbad-function-cast; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wmissing-declarations; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wmissing-prototypes; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wnested-externs; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wredundant-decls; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wshadow; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wwrite-strings; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done for flag in -Wundef; do as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 $as_echo_n "checking whether C compiler accepts $flag... " >&6; } if eval \${$as_CACHEVAR+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_CACHEVAR=yes" else eval "$as_CACHEVAR=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : if ${CFLAGS+:} false; then : case " $CFLAGS " in *" $flag "*) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5 (: CFLAGS already contains $flag) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; *) { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5 (: CFLAGS="$CFLAGS $flag") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } CFLAGS="$CFLAGS $flag" ;; esac else CFLAGS="$flag" fi else : fi done fi prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$prefix\"" eval ac_define_dir="\"$ac_define_dir\"" PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$sysconfdir\"" eval ac_define_dir="\"$ac_define_dir\"" SYSCONFDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SYSCONFDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libdir\"" eval ac_define_dir="\"$ac_define_dir\"" LIBDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define LIBDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$datadir\"" eval ac_define_dir="\"$ac_define_dir\"" DATADIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DATADIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$localstatedir\"" eval ac_define_dir="\"$ac_define_dir\"" LOCALSTATEDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define LOCALSTATEDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ac_config_files="$ac_config_files Makefile src/Makefile libltdl/Makefile modules/Makefile modules/core/Makefile doc/Makefile help/Makefile tools/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_ltlibobjs if test -z "${ENABLE_SSL_TRUE}" && test -z "${ENABLE_SSL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 ircd-hybrid $as_me 8.1.13, 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" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ ircd-hybrid config.status 8.1.13 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' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "libltdl/Makefile") CONFIG_FILES="$CONFIG_FILES libltdl/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "modules/core/Makefile") CONFIG_FILES="$CONFIG_FILES modules/core/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "help/Makefile") CONFIG_FILES="$CONFIG_FILES help/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= 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 :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$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 # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ircd-hybrid-8.1.13.dfsg.1/Makefile.in0000644000175000017500000006332612263053414015264 0ustar domdom# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in AUTHORS COPYING INSTALL NEWS README \ compile config.guess config.sub depcomp install-sh missing \ ylwrap ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/gcc_stack_protect.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBDIR = @LIBDIR@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALSTATEDIR = @LOCALSTATEDIR@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign SUBDIRS = tools libltdl doc help modules src all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-data-local install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am install-data-local: $(INSTALL) -d $(DESTDIR)${localstatedir}/log $(INSTALL) -d $(DESTDIR)${localstatedir}/run # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ircd-hybrid-8.1.13.dfsg.1/depcomp0000755000175000017500000005601612263053414014572 0ustar domdom#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ircd-hybrid-8.1.13.dfsg.1/config.guess0000755000175000017500000013135512263053414015535 0ustar domdom#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-11-29' # 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. 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 1992-2013 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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # 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 tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: ircd-hybrid-8.1.13.dfsg.1/m4/0000755000175000017500000000000012263053456013533 5ustar domdomircd-hybrid-8.1.13.dfsg.1/m4/lt~obsolete.m40000644000175000017500000001375612263053412016353 0ustar domdom# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ircd-hybrid-8.1.13.dfsg.1/m4/gcc_stack_protect.m40000644000175000017500000000621512263053412017452 0ustar domdomdnl dnl Useful macros for autoconf to check for ssp-patched gcc dnl 1.0 - September 2003 - Tiago Sousa dnl 1.1 - August 2006 - Ted Percival dnl * Stricter language checking (C or C++) dnl * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary dnl * Caches all results dnl * Uses macros to ensure correct ouput in quiet/silent mode dnl 1.2 - April 2007 - Ted Percival dnl * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation dnl * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS dnl dnl About ssp: dnl GCC extension for protecting applications from stack-smashing attacks dnl http://www.research.ibm.com/trl/projects/security/ssp/ dnl dnl Usage: dnl Most people will simply call GCC_STACK_PROTECTOR. dnl If you only use one of C or C++, you can save time by only calling the dnl macro appropriate for that language. In that case you should also call dnl GCC_STACK_PROTECT_LIB first. dnl dnl GCC_STACK_PROTECTOR dnl Tries to turn on stack protection for C and C++ by calling the following dnl three macros with the right languages. dnl dnl GCC_STACK_PROTECT_CC dnl checks -fstack-protector with the C compiler, if it exists then updates dnl CFLAGS and defines ENABLE_SSP_CC dnl dnl GCC_STACK_PROTECT_CXX dnl checks -fstack-protector with the C++ compiler, if it exists then updates dnl CXXFLAGS and defines ENABLE_SSP_CXX dnl dnl GCC_STACK_PROTECT_LIB dnl adds -lssp to LIBS if it is available dnl ssp is usually provided as part of libc, but was previously a separate lib dnl It does not hurt to add -lssp even if libc provides SSP - in that case dnl libssp will simply be ignored. dnl AC_DEFUN([GCC_STACK_PROTECT_LIB],[ AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib, [ssp_old_libs="$LIBS" LIBS="$LIBS -lssp" AC_TRY_LINK(,, ssp_cv_lib=yes, ssp_cv_lib=no) LIBS="$ssp_old_libs" ]) if test $ssp_cv_lib = yes; then LIBS="$LIBS -lssp" fi ]) AC_DEFUN([GCC_STACK_PROTECT_CC],[ AC_LANG_ASSERT(C) if test "X$CC" != "X"; then AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector], ssp_cv_cc, [ssp_old_cflags="$CFLAGS" CFLAGS="$CFLAGS -fstack-protector" AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no) CFLAGS="$ssp_old_cflags" ]) if test $ssp_cv_cc = yes; then CFLAGS="$CFLAGS -fstack-protector" AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) fi fi ]) AC_DEFUN([GCC_STACK_PROTECT_CXX],[ AC_LANG_ASSERT(C++) if test "X$CXX" != "X"; then AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector], ssp_cv_cxx, [ssp_old_cxxflags="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fstack-protector" AC_TRY_COMPILE(,, ssp_cv_cxx=yes, ssp_cv_cxx=no) CXXFLAGS="$ssp_old_cxxflags" ]) if test $ssp_cv_cxx = yes; then CXXFLAGS="$CXXFLAGS -fstack-protector" AC_DEFINE([ENABLE_SSP_CXX], 1, [Define if SSP C++ support is enabled.]) fi fi ]) AC_DEFUN([GCC_STACK_PROTECTOR],[ GCC_STACK_PROTECT_LIB AC_LANG_PUSH([C]) GCC_STACK_PROTECT_CC AC_LANG_POP([C]) AC_LANG_PUSH([C++]) GCC_STACK_PROTECT_CXX AC_LANG_POP([C++]) ]) ircd-hybrid-8.1.13.dfsg.1/m4/ltoptions.m40000644000175000017500000003007312263053412016023 0ustar domdom# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ircd-hybrid-8.1.13.dfsg.1/m4/ac_define_dir.m40000644000175000017500000000224212263053412016520 0ustar domdomdnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro sets VARNAME to the expansion of the DIR variable, dnl taking care of fixing up ${prefix} and such. dnl dnl VARNAME is then offered as both an output variable and a C dnl preprocessor symbol. dnl dnl Example: dnl dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) dnl dnl @category Misc dnl @author Stepan Kasal dnl @author Andreas Schwab dnl @author Guido U. Draheim dnl @author Alexandre Oliva dnl @version 2006-10-13 dnl @license AllPermissive AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"$ac_define_dir\"" AC_SUBST($1, "$ac_define_dir") AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) ircd-hybrid-8.1.13.dfsg.1/m4/ltsugar.m40000644000175000017500000001042412263053412015447 0ustar domdom# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ircd-hybrid-8.1.13.dfsg.1/m4/ax_check_openssl.m40000644000175000017500000000561312263053412017302 0ustar domdomAC_DEFUN([AX_CHECK_OPENSSL], [ AC_ARG_ENABLE(openssl, [ --enable-openssl[=DIR] Enable OpenSSL support (DIR optional). --disable-openssl Disable OpenSSL support. ], [ cf_enable_openssl=$enableval ], [ cf_enable_openssl="auto" ]) AC_MSG_CHECKING([for OpenSSL]) if test "$cf_enable_openssl" != "no"; then cf_openssl_basedir="" if test "$cf_enable_openssl" != "auto" && test "$cf_enable_openssl" != "yes"; then dnl Support for --enable-openssl=/some/place cf_openssl_basedir="${cf_enable_openssl}" else dnl Do the auto-probe here. Check some common directory paths. for dirs in /usr/local/ssl /usr/pkg /usr/local /usr/lib /usr/lib/ssl\ /opt /opt/openssl /usr/local/openssl; do if test -f "${dirs}/include/openssl/opensslv.h"; then cf_openssl_basedir="${dirs}" break fi done unset dirs fi dnl Now check cf_openssl_found to see if we found anything. if test ! -z "$cf_openssl_basedir"; then if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h"; then CPPFLAGS="-I${cf_openssl_basedir}/include $CPPFLAGS" LDFLAGS="-L${cf_openssl_basedir}/lib $LDFLAGS" else dnl OpenSSL wasn't found in the directory specified. Naughty dnl administrator... cf_openssl_basedir="" fi else dnl Check for stock FreeBSD 4.x and 5.x systems, since their files dnl are in /usr/include and /usr/lib. In this case, we don't want to dnl change INCLUDES or LIBS, but still want to enable OpenSSL. dnl We can't do this check above, because some people want two versions dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl) dnl and they want /usr/local/ssl to have preference. if test -f "/usr/include/openssl/opensslv.h"; then cf_openssl_basedir="/usr" fi fi dnl If we have a basedir defined, then everything is okay. Otherwise, dnl we have a problem. if test ! -z "$cf_openssl_basedir"; then AC_MSG_RESULT([$cf_openssl_basedir]) cf_enable_openssl="yes" else AC_MSG_RESULT([not found. Please check your path.]) cf_enable_openssl="no" fi unset cf_openssl_basedir else dnl If --disable-openssl was specified AC_MSG_RESULT([disabled]) fi AS_IF([test "$cf_enable_openssl" != "no"], [AC_MSG_CHECKING(for OpenSSL 0.9.8 or above) AC_RUN_IFELSE([ AC_LANG_PROGRAM([ #include #include ], [[ exit(!(OPENSSL_VERSION_NUMBER >= 0x00908000)); ]])], [cf_openssl_version_ok=yes], [cf_openssl_version_ok=no], [cf_openssl_version_ok=no]) AS_IF([test "$cf_openssl_version_ok" = "yes"], [AC_MSG_RESULT(found) AC_CHECK_LIB(crypto, RSA_free) AS_IF([test "$ac_cv_lib_crypto_RSA_free" = "yes"], [AC_CHECK_LIB(ssl, SSL_connect)]) ],[AC_MSG_RESULT(no - OpenSSL support disabled) cf_enable_openssl="no"])]) AM_CONDITIONAL(ENABLE_SSL, [test "$ac_cv_lib_ssl_SSL_connect" = yes]) ]) ircd-hybrid-8.1.13.dfsg.1/m4/ax_append_compile_flags.m40000644000175000017500000000551112263053412020612 0ustar domdom# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) # # DESCRIPTION # # For every FLAG1, FLAG2 it is checked whether the compiler works with the # flag. If it does, the flag is added FLAGS-VARIABLE # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. During the check the flag is always added to the # current language's flags. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: This macro depends on the AX_APPEND_FLAG and # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with # AX_APPEND_LINK_FLAGS. # # LICENSE # # Copyright (c) 2011 Maarten Bosmans # # 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 3 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 3 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AC_REQUIRE([AX_CHECK_COMPILE_FLAG]) AC_REQUIRE([AX_APPEND_FLAG]) for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) done ])dnl AX_APPEND_COMPILE_FLAGS ircd-hybrid-8.1.13.dfsg.1/m4/ax_check_compile_flag.m40000644000175000017500000000625112263053412020237 0ustar domdom# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 3 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS ircd-hybrid-8.1.13.dfsg.1/m4/ax_append_flag.m40000644000175000017500000000530412263053412016717 0ustar domdom# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_append_flag.html # =========================================================================== # # SYNOPSIS # # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space # added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # 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 3 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 2 AC_DEFUN([AX_APPEND_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl AS_VAR_SET_IF(FLAGS, [case " AS_VAR_GET(FLAGS) " in *" $1 "*) AC_RUN_LOG([: FLAGS already contains $1]) ;; *) AC_RUN_LOG([: FLAGS="$FLAGS $1"]) AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) ;; esac], [AS_VAR_SET(FLAGS,["$1"])]) AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_APPEND_FLAG ircd-hybrid-8.1.13.dfsg.1/m4/ltdl.m40000644000175000017500000006466312263053412014743 0ustar domdom# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 18 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise # to `${top_builddir}/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [${top_build_prefix}], [${top_builddir}/])], [${top_build_prefix}])], [${top_builddir}/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '${top_build_prefix}' if available, otherwise with '${top_builddir}/', # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if # available, otherwise with '${top_builddir}/', and LTDLINCL will be # prefixed with '${top_srcdir}/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f $prefix/lib/libltdl.la; then lt_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS="$lt_save_LDFLAGS" if test x"${lt_lib_ltdl-no}" = xyes; then if test x"$enable_ltdl_install" != xyes; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) enable_ltdl_install=no fi elif test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is `subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([gl_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$lt_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" _LT_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) ircd-hybrid-8.1.13.dfsg.1/m4/argz.m40000644000175000017500000000507112263053412014733 0ustar domdom# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test "$lt_cv_sys_argz_works" = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) ircd-hybrid-8.1.13.dfsg.1/m4/ltversion.m40000644000175000017500000000126212263053412016013 0ustar domdom# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) ircd-hybrid-8.1.13.dfsg.1/m4/libtool.m40000644000175000017500000105721612263053412015445 0ustar domdom# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ircd-hybrid-8.1.13.dfsg.1/src/0000755000175000017500000000000012263053456014002 5ustar domdomircd-hybrid-8.1.13.dfsg.1/src/s_gline.c0000644000175000017500000000547312263053413015570 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_gline.c: GLine global ban functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_gline.c 1996 2013-05-11 17:34:41Z michael $ */ #include "stdinc.h" #include "list.h" #include "client.h" #include "irc_string.h" #include "ircd.h" #include "conf.h" #include "hostmask.h" #include "s_misc.h" #include "send.h" #include "s_serv.h" #include "s_gline.h" #include "event.h" #include "memory.h" dlink_list pending_glines[GLINE_PENDING_ADD_TYPE + 1] = { { NULL, NULL, 0 }, { NULL, NULL, 0 } }; struct MaskItem * find_is_glined(const char *host, const char *user) { struct irc_ssaddr iphost, *piphost = NULL; struct MaskItem *conf = NULL; int t = 0; int aftype = 0; if ((t = parse_netmask(host, &iphost, NULL)) != HM_HOST) { #ifdef IPV6 if (t == HM_IPV6) aftype = AF_INET6; else #endif aftype = AF_INET; piphost = &iphost; } else piphost = NULL; conf = find_conf_by_address(host, piphost, CONF_GLINE, aftype, user, NULL, 0); return conf; } /* expire_pending_glines() * * inputs - NONE * output - NONE * side effects - * * Go through the pending gline list, expire any that haven't had * enough "votes" in the time period allowed */ static void expire_pending_glines(struct gline_pending *in) { dlink_node *ptr = NULL, *next_ptr = NULL; unsigned int idx = 0; for (; idx < GLINE_PENDING_ADD_TYPE + 1; ++idx) { DLINK_FOREACH_SAFE(ptr, next_ptr, pending_glines[idx].head) { struct gline_pending *glp_ptr = ptr->data; if ((glp_ptr->last_gline_time + ConfigFileEntry.gline_request_time) <= CurrentTime || glp_ptr == in) { dlinkDelete(&glp_ptr->node, &pending_glines[idx]); MyFree(glp_ptr); } } } } /* cleanup_glines() * * inputs - NONE * output - NONE * side effects - expire gline lists * This is an event started off in ircd.c */ void cleanup_glines(void *unused) { expire_pending_glines(unused); } ircd-hybrid-8.1.13.dfsg.1/src/channel.c0000644000175000017500000006010512263053413015551 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file channel.c * \brief Responsible for managing channels, members, bans and topics * \version $Id: channel.c 2568 2013-11-17 20:24:04Z michael $ */ #include "stdinc.h" #include "list.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "hash.h" #include "conf.h" #include "hostmask.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "s_serv.h" /* captab */ #include "s_user.h" #include "send.h" #include "event.h" #include "memory.h" #include "mempool.h" #include "s_misc.h" #include "resv.h" struct config_channel_entry ConfigChannel; dlink_list global_channel_list = { NULL, NULL, 0 }; mp_pool_t *ban_pool; /*! \todo ban_pool shouldn't be a global var */ static mp_pool_t *member_pool = NULL; static mp_pool_t *channel_pool = NULL; static char buf[IRCD_BUFSIZE]; static char modebuf[MODEBUFLEN]; static char parabuf[MODEBUFLEN]; /*! \brief Initializes the channel blockheap, adds known channel CAPAB */ void channel_init(void) { add_capability("EX", CAP_EX, 1); add_capability("IE", CAP_IE, 1); add_capability("CHW", CAP_CHW, 1); channel_pool = mp_pool_new(sizeof(struct Channel), MP_CHUNK_SIZE_CHANNEL); ban_pool = mp_pool_new(sizeof(struct Ban), MP_CHUNK_SIZE_BAN); member_pool = mp_pool_new(sizeof(struct Membership), MP_CHUNK_SIZE_MEMBER); } /*! \brief adds a user to a channel by adding another link to the * channels member chain. * \param chptr pointer to channel to add client to * \param who pointer to client (who) to add * \param flags flags for chanops etc * \param flood_ctrl whether to count this join in flood calculations */ void add_user_to_channel(struct Channel *chptr, struct Client *who, unsigned int flags, int flood_ctrl) { struct Membership *ms = NULL; if (GlobalSetOptions.joinfloodtime > 0) { if (flood_ctrl) chptr->number_joined++; chptr->number_joined -= (CurrentTime - chptr->last_join_time) * (((float)GlobalSetOptions.joinfloodcount) / (float)GlobalSetOptions.joinfloodtime); if (chptr->number_joined <= 0) { chptr->number_joined = 0; ClearJoinFloodNoticed(chptr); } else if (chptr->number_joined >= GlobalSetOptions.joinfloodcount) { chptr->number_joined = GlobalSetOptions.joinfloodcount; if (!IsSetJoinFloodNoticed(chptr)) { SetJoinFloodNoticed(chptr); sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE, "Possible Join Flooder %s on %s target: %s", get_client_name(who, HIDE_IP), who->servptr->name, chptr->chname); } } chptr->last_join_time = CurrentTime; } ms = mp_pool_get(member_pool); memset(ms, 0, sizeof(*ms)); ms->client_p = who; ms->chptr = chptr; ms->flags = flags; dlinkAdd(ms, &ms->channode, &chptr->members); dlinkAdd(ms, &ms->usernode, &who->channel); } /*! \brief deletes an user from a channel by removing a link in the * channels member chain. * \param member pointer to Membership struct */ void remove_user_from_channel(struct Membership *member) { struct Client *client_p = member->client_p; struct Channel *chptr = member->chptr; dlinkDelete(&member->channode, &chptr->members); dlinkDelete(&member->usernode, &client_p->channel); mp_pool_release(member); if (chptr->members.head == NULL) destroy_channel(chptr); } /* send_members() * * inputs - * output - NONE * side effects - */ static void send_members(struct Client *client_p, struct Channel *chptr, char *lmodebuf, char *lparabuf) { const dlink_node *ptr = NULL; int tlen; /* length of text to append */ char *t, *start; /* temp char pointer */ start = t = buf + snprintf(buf, sizeof(buf), ":%s SJOIN %lu %s %s %s:", ID_or_name(&me, client_p), (unsigned long)chptr->channelts, chptr->chname, lmodebuf, lparabuf); DLINK_FOREACH(ptr, chptr->members.head) { const struct Membership *ms = ptr->data; tlen = strlen(IsCapable(client_p, CAP_TS6) ? ID(ms->client_p) : ms->client_p->name) + 1; /* nick + space */ if (ms->flags & CHFL_CHANOP) tlen++; #ifdef HALFOPS else if (ms->flags & CHFL_HALFOP) tlen++; #endif if (ms->flags & CHFL_VOICE) tlen++; /* space will be converted into CR, but we also need space for LF.. * That's why we use '- 1' here * -adx */ if (t + tlen - buf > IRCD_BUFSIZE - 1) { *(t - 1) = '\0'; /* kill the space and terminate the string */ sendto_one(client_p, "%s", buf); t = start; } if ((ms->flags & (CHFL_CHANOP | CHFL_HALFOP))) *t++ = (!(ms->flags & CHFL_CHANOP) && IsCapable(client_p, CAP_HOPS)) ? '%' : '@'; if ((ms->flags & CHFL_VOICE)) *t++ = '+'; if (IsCapable(client_p, CAP_TS6)) strcpy(t, ID(ms->client_p)); else strcpy(t, ms->client_p->name); t += strlen(t); *t++ = ' '; } /* should always be non-NULL unless we have a kind of persistent channels */ if (chptr->members.head != NULL) t--; /* take the space out */ *t = '\0'; sendto_one(client_p, "%s", buf); } /*! \brief sends +b/+e/+I * \param client_p client pointer to server * \param chptr pointer to channel * \param top pointer to top of mode link list to send * \param flag char flag flagging type of mode. Currently this can be 'b', e' or 'I' */ static void send_mode_list(struct Client *client_p, struct Channel *chptr, const dlink_list *top, char flag) { int ts5 = !IsCapable(client_p, CAP_TS6); const dlink_node *lp = NULL; char pbuf[IRCD_BUFSIZE]; int tlen, mlen, cur_len, count = 0; char *mp = NULL, *pp = pbuf; if (top == NULL || top->length == 0) return; if (ts5) mlen = snprintf(buf, sizeof(buf), ":%s MODE %s +", me.name, chptr->chname); else mlen = snprintf(buf, sizeof(buf), ":%s BMASK %lu %s %c :", me.id, (unsigned long)chptr->channelts, chptr->chname, flag); /* MODE needs additional one byte for space between buf and pbuf */ cur_len = mlen + ts5; mp = buf + mlen; DLINK_FOREACH(lp, top->head) { const struct Ban *banptr = lp->data; /* must add another b/e/I letter if we use MODE */ tlen = banptr->len + 3 + ts5; /* * send buffer and start over if we cannot fit another ban, * or if the target is non-ts6 and we have too many modes in * in this line. */ if (cur_len + (tlen - 1) > IRCD_BUFSIZE - 2 || (!IsCapable(client_p, CAP_TS6) && (count >= MAXMODEPARAMS || pp - pbuf >= MODEBUFLEN))) { *(pp - 1) = '\0'; /* get rid of trailing space on buffer */ sendto_one(client_p, "%s%s%s", buf, ts5 ? " " : "", pbuf); cur_len = mlen + ts5; mp = buf + mlen; pp = pbuf; count = 0; } count++; if (ts5) { *mp++ = flag; *mp = '\0'; } pp += sprintf(pp, "%s!%s@%s ", banptr->name, banptr->user, banptr->host); cur_len += tlen; } *(pp - 1) = '\0'; /* get rid of trailing space on buffer */ sendto_one(client_p, "%s%s%s", buf, ts5 ? " " : "", pbuf); } /*! \brief send "client_p" a full list of the modes for channel chptr * \param client_p pointer to client client_p * \param chptr pointer to channel pointer */ void send_channel_modes(struct Client *client_p, struct Channel *chptr) { *modebuf = *parabuf = '\0'; channel_modes(chptr, client_p, modebuf, parabuf); send_members(client_p, chptr, modebuf, parabuf); send_mode_list(client_p, chptr, &chptr->banlist, 'b'); send_mode_list(client_p, chptr, &chptr->exceptlist, 'e'); send_mode_list(client_p, chptr, &chptr->invexlist, 'I'); } /*! \brief check channel name for invalid characters * \param name pointer to channel name string * \param local indicates whether it's a local or remote creation * \return 0 if invalid, 1 otherwise */ int check_channel_name(const char *name, const int local) { const char *p = name; const int max_length = local ? LOCAL_CHANNELLEN : CHANNELLEN; assert(name != NULL); if (!IsChanPrefix(*p)) return 0; if (!local || !ConfigChannel.disable_fake_channels) { while (*++p) if (!IsChanChar(*p)) return 0; } else { while (*++p) if (!IsVisibleChanChar(*p)) return 0; } return p - name <= max_length; } void remove_ban(struct Ban *bptr, dlink_list *list) { dlinkDelete(&bptr->node, list); MyFree(bptr->name); MyFree(bptr->user); MyFree(bptr->host); MyFree(bptr->who); mp_pool_release(bptr); } /* free_channel_list() * * inputs - pointer to dlink_list * output - NONE * side effects - */ void free_channel_list(dlink_list *list) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, list->head) remove_ban(ptr->data, list); assert(list->tail == NULL && list->head == NULL); } /*! \brief Get Channel block for chname (and allocate a new channel * block, if it didn't exist before) * \param chname channel name * \return channel block */ struct Channel * make_channel(const char *chname) { struct Channel *chptr = NULL; assert(!EmptyString(chname)); chptr = mp_pool_get(channel_pool); memset(chptr, 0, sizeof(*chptr)); /* doesn't hurt to set it here */ chptr->channelts = CurrentTime; chptr->last_join_time = CurrentTime; strlcpy(chptr->chname, chname, sizeof(chptr->chname)); dlinkAdd(chptr, &chptr->node, &global_channel_list); hash_add_channel(chptr); return chptr; } /*! \brief walk through this channel, and destroy it. * \param chptr channel pointer */ void destroy_channel(struct Channel *chptr) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, chptr->invites.head) del_invite(chptr, ptr->data); /* free ban/exception/invex lists */ free_channel_list(&chptr->banlist); free_channel_list(&chptr->exceptlist); free_channel_list(&chptr->invexlist); dlinkDelete(&chptr->node, &global_channel_list); hash_del_channel(chptr); mp_pool_release(chptr); } /*! * \param chptr pointer to channel * \return string pointer "=" if public, "@" if secret else "*" */ static const char * channel_pub_or_secret(const struct Channel *chptr) { if (SecretChannel(chptr)) return "@"; if (PrivateChannel(chptr)) return "*"; return "="; } /*! \brief lists all names on given channel * \param source_p pointer to client struct requesting names * \param chptr pointer to channel block * \param show_eon show ENDOFNAMES numeric or not * (don't want it with /names with no params) */ void channel_member_names(struct Client *source_p, struct Channel *chptr, int show_eon) { const dlink_node *ptr = NULL; char lbuf[IRCD_BUFSIZE + 1]; char *t = NULL, *start = NULL; int tlen = 0; int is_member = IsMember(source_p, chptr); int multi_prefix = HasCap(source_p, CAP_MULTI_PREFIX) != 0; if (PubChannel(chptr) || is_member) { t = lbuf + snprintf(lbuf, sizeof(lbuf), form_str(RPL_NAMREPLY), me.name, source_p->name, channel_pub_or_secret(chptr), chptr->chname); start = t; DLINK_FOREACH(ptr, chptr->members.head) { const struct Membership *ms = ptr->data; if (HasUMode(ms->client_p, UMODE_INVISIBLE) && !is_member) continue; tlen = strlen(ms->client_p->name) + 1; /* nick + space */ if (!multi_prefix) { if (ms->flags & (CHFL_CHANOP | CHFL_HALFOP | CHFL_VOICE)) ++tlen; } else { if (ms->flags & CHFL_CHANOP) ++tlen; if (ms->flags & CHFL_HALFOP) ++tlen; if (ms->flags & CHFL_VOICE) ++tlen; } if (t + tlen - lbuf > IRCD_BUFSIZE - 2) { *(t - 1) = '\0'; sendto_one(source_p, "%s", lbuf); t = start; } t += sprintf(t, "%s%s ", get_member_status(ms, multi_prefix), ms->client_p->name); } if (tlen != 0) { *(t - 1) = '\0'; sendto_one(source_p, "%s", lbuf); } } if (show_eon) sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, chptr->chname); } /*! \brief adds client to invite list * \param chptr pointer to channel block * \param who pointer to client to add invite to */ void add_invite(struct Channel *chptr, struct Client *who) { del_invite(chptr, who); /* * delete last link in chain if the list is max length */ if (dlink_list_length(&who->localClient->invited) >= ConfigChannel.max_chans_per_user) del_invite(who->localClient->invited.tail->data, who); /* add client to channel invite list */ dlinkAdd(who, make_dlink_node(), &chptr->invites); /* add channel to the end of the client invite list */ dlinkAdd(chptr, make_dlink_node(), &who->localClient->invited); } /*! \brief Delete Invite block from channel invite list * and client invite list * \param chptr pointer to Channel struct * \param who pointer to client to remove invites from */ void del_invite(struct Channel *chptr, struct Client *who) { dlink_node *ptr = NULL; if ((ptr = dlinkFindDelete(&who->localClient->invited, chptr))) free_dlink_node(ptr); if ((ptr = dlinkFindDelete(&chptr->invites, who))) free_dlink_node(ptr); } /* get_member_status() * * inputs - pointer to struct Membership * - YES if we can combine different flags * output - string either @, +, % or "" depending on whether * chanop, voiced or user * side effects - * * NOTE: Returned string is usually a static buffer * (like in get_client_name) */ const char * get_member_status(const struct Membership *ms, const int combine) { static char buffer[4]; char *p = buffer; if (ms->flags & CHFL_CHANOP) { if (!combine) return "@"; *p++ = '@'; } #ifdef HALFOPS if (ms->flags & CHFL_HALFOP) { if (!combine) return "%"; *p++ = '%'; } #endif if (ms->flags & CHFL_VOICE) *p++ = '+'; *p = '\0'; return buffer; } /*! * \param who pointer to Client to check * \param list pointer to ban list to search * \return 1 if ban found for given n!u\@h mask, 0 otherwise * */ static int find_bmask(const struct Client *who, const dlink_list *const list) { const dlink_node *ptr = NULL; DLINK_FOREACH(ptr, list->head) { const struct Ban *bp = ptr->data; if (!match(bp->name, who->name) && !match(bp->user, who->username)) { switch (bp->type) { case HM_HOST: if (!match(bp->host, who->host) || !match(bp->host, who->sockhost)) return 1; break; case HM_IPV4: if (who->localClient->aftype == AF_INET) if (match_ipv4(&who->localClient->ip, &bp->addr, bp->bits)) return 1; break; #ifdef IPV6 case HM_IPV6: if (who->localClient->aftype == AF_INET6) if (match_ipv6(&who->localClient->ip, &bp->addr, bp->bits)) return 1; break; #endif default: assert(0); } } } return 0; } /*! * \param chptr pointer to channel block * \param who pointer to client to check access fo * \return 0 if not banned, 1 otherwise */ int is_banned(const struct Channel *chptr, const struct Client *who) { if (find_bmask(who, &chptr->banlist)) if (!find_bmask(who, &chptr->exceptlist)) return 1; return 0; } /*! * \param source_p pointer to client attempting to join * \param chptr pointer to channel * \param key key sent by client attempting to join if present * \return ERR_BANNEDFROMCHAN, ERR_INVITEONLYCHAN, ERR_CHANNELISFULL * or 0 if allowed to join. */ int can_join(struct Client *source_p, struct Channel *chptr, const char *key) { if ((chptr->mode.mode & MODE_SSLONLY) && !HasUMode(source_p, UMODE_SSL)) return ERR_SSLONLYCHAN; if ((chptr->mode.mode & MODE_REGONLY) && !HasUMode(source_p, UMODE_REGISTERED)) return ERR_NEEDREGGEDNICK; if ((chptr->mode.mode & MODE_OPERONLY) && !HasUMode(source_p, UMODE_OPER)) return ERR_OPERONLYCHAN; if (chptr->mode.mode & MODE_INVITEONLY) if (!dlinkFind(&source_p->localClient->invited, chptr)) if (!find_bmask(source_p, &chptr->invexlist)) return ERR_INVITEONLYCHAN; if (chptr->mode.key[0] && (!key || strcmp(chptr->mode.key, key))) return ERR_BADCHANNELKEY; if (chptr->mode.limit && dlink_list_length(&chptr->members) >= chptr->mode.limit) return ERR_CHANNELISFULL; if (is_banned(chptr, source_p)) return ERR_BANNEDFROMCHAN; return 0; } int has_member_flags(const struct Membership *ms, const unsigned int flags) { if (ms != NULL) return ms->flags & flags; return 0; } struct Membership * find_channel_link(struct Client *client_p, struct Channel *chptr) { dlink_node *ptr = NULL; if (!IsClient(client_p)) return NULL; if (dlink_list_length(&chptr->members) < dlink_list_length(&client_p->channel)) { DLINK_FOREACH(ptr, chptr->members.head) if (((struct Membership *)ptr->data)->client_p == client_p) return ptr->data; } else { DLINK_FOREACH(ptr, client_p->channel.head) if (((struct Membership *)ptr->data)->chptr == chptr) return ptr->data; } return NULL; } /* * Basically the same functionality as in bahamut */ static int msg_has_ctrls(const char *message) { const unsigned char *p = (const unsigned char *)message; for (; *p; ++p) { if (*p > 31 || *p == 1) continue; if (*p == 27) { if (*(p + 1) == '$' || *(p + 1) == '(') { ++p; continue; } } return 1; } return 0; } /*! * \param chptr pointer to Channel struct * \param source_p pointer to Client struct * \param ms pointer to Membership struct (can be NULL) * \return CAN_SEND_OPV if op or voiced on channel\n * CAN_SEND_NONOP if can send to channel but is not an op\n * ERR_CANNOTSENDTOCHAN or ERR_NEEDREGGEDNICK if they cannot send to channel\n */ int can_send(struct Channel *chptr, struct Client *source_p, struct Membership *ms, const char *message) { struct MaskItem *conf = NULL; if (IsServer(source_p) || HasFlag(source_p, FLAGS_SERVICE)) return CAN_SEND_OPV; if (MyClient(source_p) && !IsExemptResv(source_p)) if (!(HasUMode(source_p, UMODE_OPER) && ConfigFileEntry.oper_pass_resv)) if ((conf = match_find_resv(chptr->chname)) && !resv_find_exempt(source_p, conf)) return ERR_CANNOTSENDTOCHAN; if ((chptr->mode.mode & MODE_NOCTRL) && msg_has_ctrls(message)) return ERR_NOCTRLSONCHAN; if (ms || (ms = find_channel_link(source_p, chptr))) if (ms->flags & (CHFL_CHANOP|CHFL_HALFOP|CHFL_VOICE)) return CAN_SEND_OPV; if (!ms && (chptr->mode.mode & MODE_NOPRIVMSGS)) return ERR_CANNOTSENDTOCHAN; if (chptr->mode.mode & MODE_MODERATED) return ERR_CANNOTSENDTOCHAN; if ((chptr->mode.mode & MODE_MODREG) && !HasUMode(source_p, UMODE_REGISTERED)) return ERR_NEEDREGGEDNICK; /* cache can send if banned */ if (MyClient(source_p)) { if (ms) { if (ms->flags & CHFL_BAN_SILENCED) return ERR_CANNOTSENDTOCHAN; if (!(ms->flags & CHFL_BAN_CHECKED)) { if (is_banned(chptr, source_p)) { ms->flags |= (CHFL_BAN_CHECKED|CHFL_BAN_SILENCED); return ERR_CANNOTSENDTOCHAN; } ms->flags |= CHFL_BAN_CHECKED; } } else if (is_banned(chptr, source_p)) return ERR_CANNOTSENDTOCHAN; } return CAN_SEND_NONOP; } /*! \brief Updates the client's oper_warn_count_down, warns the * IRC operators if necessary, and updates * join_leave_countdown as needed. * \param source_p pointer to struct Client to check * \param name channel name or NULL if this is a part. */ void check_spambot_warning(struct Client *source_p, const char *name) { int t_delta = 0; int decrement_count = 0; if ((GlobalSetOptions.spam_num && (source_p->localClient->join_leave_count >= GlobalSetOptions.spam_num))) { if (source_p->localClient->oper_warn_count_down > 0) source_p->localClient->oper_warn_count_down--; else source_p->localClient->oper_warn_count_down = 0; if (source_p->localClient->oper_warn_count_down == 0) { /* Its already known as a possible spambot */ if (name != NULL) sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE, "User %s (%s@%s) trying to join %s is a possible spambot", source_p->name, source_p->username, source_p->host, name); else sendto_realops_flags(UMODE_BOTS, L_ALL, SEND_NOTICE, "User %s (%s@%s) is a possible spambot", source_p->name, source_p->username, source_p->host); source_p->localClient->oper_warn_count_down = OPER_SPAM_COUNTDOWN; } } else { if ((t_delta = (CurrentTime - source_p->localClient->last_leave_time)) > JOIN_LEAVE_COUNT_EXPIRE_TIME) { decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME); if (decrement_count > source_p->localClient->join_leave_count) source_p->localClient->join_leave_count = 0; else source_p->localClient->join_leave_count -= decrement_count; } else { if ((CurrentTime - (source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time) { /* oh, its a possible spambot */ source_p->localClient->join_leave_count++; } } if (name != NULL) source_p->localClient->last_join_time = CurrentTime; else source_p->localClient->last_leave_time = CurrentTime; } } /*! \brief compares usercount and servercount against their split * values and adjusts splitmode accordingly * \param unused Unused address pointer */ void check_splitmode(void *unused) { if (splitchecking && (ConfigChannel.no_join_on_split || ConfigChannel.no_create_on_split)) { const unsigned int server = dlink_list_length(&global_serv_list); if (!splitmode && ((server < split_servers) || (Count.total < split_users))) { splitmode = 1; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Network split, activating splitmode"); eventAddIsh("check_splitmode", check_splitmode, NULL, 10); } else if (splitmode && (server > split_servers) && (Count.total > split_users)) { splitmode = 0; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Network rejoined, deactivating splitmode"); eventDelete(check_splitmode, NULL); } } } /*! \brief Sets the channel topic for chptr * \param chptr Pointer to struct Channel * \param topic The topic string * \param topic_info n!u\@h formatted string of the topic setter * \param topicts timestamp on the topic */ void set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_info, time_t topicts, int local) { if (local) strlcpy(chptr->topic, topic, IRCD_MIN(sizeof(chptr->topic), ServerInfo.max_topic_length + 1)); else strlcpy(chptr->topic, topic, sizeof(chptr->topic)); strlcpy(chptr->topic_info, topic_info, sizeof(chptr->topic_info)); chptr->topic_time = topicts; } ircd-hybrid-8.1.13.dfsg.1/src/conf.c0000644000175000017500000016266012263053413015077 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * conf.c: Configuration file functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: conf.c 2735 2014-01-03 19:37:07Z michael $ */ #include "stdinc.h" #include "list.h" #include "ircd_defs.h" #include "conf.h" #include "s_serv.h" #include "resv.h" #include "channel.h" #include "client.h" #include "event.h" #include "hook.h" #include "irc_string.h" #include "s_bsd.h" #include "ircd.h" #include "listener.h" #include "hostmask.h" #include "modules.h" #include "numeric.h" #include "fdlist.h" #include "log.h" #include "send.h" #include "s_gline.h" #include "memory.h" #include "mempool.h" #include "irc_res.h" #include "userhost.h" #include "s_user.h" #include "channel_mode.h" #include "parse.h" #include "s_misc.h" #include "conf_db.h" #include "conf_class.h" #include "motd.h" struct config_server_hide ConfigServerHide; /* general conf items link list root, other than k lines etc. */ dlink_list service_items = { NULL, NULL, 0 }; dlink_list server_items = { NULL, NULL, 0 }; dlink_list cluster_items = { NULL, NULL, 0 }; dlink_list oconf_items = { NULL, NULL, 0 }; dlink_list uconf_items = { NULL, NULL, 0 }; dlink_list xconf_items = { NULL, NULL, 0 }; dlink_list nresv_items = { NULL, NULL, 0 }; dlink_list cresv_items = { NULL, NULL, 0 }; extern unsigned int lineno; extern char linebuf[]; extern char conffilebuf[IRCD_BUFSIZE]; extern int yyparse(); /* defined in y.tab.c */ struct conf_parser_context conf_parser_ctx = { 0, 0, NULL }; /* internally defined functions */ static void read_conf(FILE *); static void clear_out_old_conf(void); static void expire_tklines(dlink_list *); static void garbage_collect_ip_entries(void); static int hash_ip(struct irc_ssaddr *); static int verify_access(struct Client *); static int attach_iline(struct Client *, struct MaskItem *); static struct ip_entry *find_or_add_ip(struct irc_ssaddr *); static dlink_list *map_to_list(enum maskitem_type); static int find_user_host(struct Client *, char *, char *, char *, unsigned int); /* usually, with hash tables, you use a prime number... * but in this case I am dealing with ip addresses, * not ascii strings. */ #define IP_HASH_SIZE 0x1000 struct ip_entry { struct irc_ssaddr ip; unsigned int count; time_t last_attempt; struct ip_entry *next; }; static struct ip_entry *ip_hash_table[IP_HASH_SIZE]; static mp_pool_t *ip_entry_pool = NULL; static int ip_entries_count = 0; /* conf_dns_callback() * * inputs - pointer to struct MaskItem * - pointer to DNSReply reply * output - none * side effects - called when resolver query finishes * if the query resulted in a successful search, hp will contain * a non-null pointer, otherwise hp will be null. * if successful save hp in the conf item it was called with */ static void conf_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) { struct MaskItem *conf = vptr; conf->dns_pending = 0; if (addr != NULL) memcpy(&conf->addr, addr, sizeof(conf->addr)); else conf->dns_failed = 1; } /* conf_dns_lookup() * * do a nameserver lookup of the conf host * if the conf entry is currently doing a ns lookup do nothing, otherwise * allocate a dns_query and start ns lookup. */ static void conf_dns_lookup(struct MaskItem *conf) { if (!conf->dns_pending) { conf->dns_pending = 1; gethost_byname(conf_dns_callback, conf, conf->host); } } struct MaskItem * conf_make(enum maskitem_type type) { struct MaskItem *conf = MyMalloc(sizeof(*conf)); dlink_list *list = NULL; conf->type = type; conf->active = 1; conf->aftype = AF_INET; if ((list = map_to_list(type))) dlinkAdd(conf, &conf->node, list); return conf; } void conf_free(struct MaskItem *conf) { dlink_node *ptr = NULL, *ptr_next = NULL; dlink_list *list = NULL; if (conf->node.next) if ((list = map_to_list(conf->type))) dlinkDelete(&conf->node, list); MyFree(conf->name); if (conf->dns_pending) delete_resolver_queries(conf); if (conf->passwd != NULL) memset(conf->passwd, 0, strlen(conf->passwd)); if (conf->spasswd != NULL) memset(conf->spasswd, 0, strlen(conf->spasswd)); conf->class = NULL; MyFree(conf->passwd); MyFree(conf->spasswd); MyFree(conf->reason); MyFree(conf->certfp); MyFree(conf->user); MyFree(conf->host); #ifdef HAVE_LIBCRYPTO MyFree(conf->cipher_list); if (conf->rsa_public_key) RSA_free(conf->rsa_public_key); #endif DLINK_FOREACH_SAFE(ptr, ptr_next, conf->hub_list.head) { MyFree(ptr->data); dlinkDelete(ptr, &conf->hub_list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, conf->leaf_list.head) { MyFree(ptr->data); dlinkDelete(ptr, &conf->leaf_list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, conf->exempt_list.head) { struct exempt *exptr = ptr->data; dlinkDelete(ptr, &conf->exempt_list); MyFree(exptr->name); MyFree(exptr->user); MyFree(exptr->host); MyFree(exptr); } MyFree(conf); } /* check_client() * * inputs - pointer to client * output - 0 = Success * NOT_AUTHORIZED (-1) = Access denied (no I line match) * IRCD_SOCKET_ERROR (-2) = Bad socket. * I_LINE_FULL (-3) = I-line is full * TOO_MANY (-4) = Too many connections from hostname * BANNED_CLIENT (-5) = K-lined * side effects - Ordinary client access check. * Look for conf lines which have the same * status as the flags passed. */ int check_client(struct Client *source_p) { int i; if ((i = verify_access(source_p))) ilog(LOG_TYPE_IRCD, "Access denied: %s[%s]", source_p->name, source_p->sockhost); switch (i) { case TOO_MANY: sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE, "Too many on IP for %s (%s).", get_client_name(source_p, SHOW_IP), source_p->sockhost); ilog(LOG_TYPE_IRCD, "Too many connections on IP from %s.", get_client_name(source_p, SHOW_IP)); ++ServerStats.is_ref; exit_client(source_p, &me, "No more connections allowed on that IP"); break; case I_LINE_FULL: sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE, "auth{} block is full for %s (%s).", get_client_name(source_p, SHOW_IP), source_p->sockhost); ilog(LOG_TYPE_IRCD, "Too many connections from %s.", get_client_name(source_p, SHOW_IP)); ++ServerStats.is_ref; exit_client(source_p, &me, "No more connections allowed in your connection class"); break; case NOT_AUTHORIZED: ++ServerStats.is_ref; /* jdc - lists server name & port connections are on */ /* a purely cosmetical change */ sendto_realops_flags(UMODE_UNAUTH, L_ALL, SEND_NOTICE, "Unauthorized client connection from %s [%s] on [%s/%u].", get_client_name(source_p, SHOW_IP), source_p->sockhost, source_p->localClient->listener->name, source_p->localClient->listener->port); ilog(LOG_TYPE_IRCD, "Unauthorized client connection from %s on [%s/%u].", get_client_name(source_p, SHOW_IP), source_p->localClient->listener->name, source_p->localClient->listener->port); exit_client(source_p, &me, "You are not authorized to use this server"); break; case BANNED_CLIENT: exit_client(source_p, &me, "Banned"); ++ServerStats.is_ref; break; case 0: default: break; } return (i < 0 ? 0 : 1); } /* verify_access() * * inputs - pointer to client to verify * output - 0 if success -'ve if not * side effect - find the first (best) I line to attach. */ static int verify_access(struct Client *client_p) { struct MaskItem *conf = NULL; char non_ident[USERLEN + 1] = { '~', '\0' }; if (IsGotId(client_p)) { conf = find_address_conf(client_p->host, client_p->username, &client_p->localClient->ip, client_p->localClient->aftype, client_p->localClient->passwd); } else { strlcpy(non_ident + 1, client_p->username, sizeof(non_ident) - 1); conf = find_address_conf(client_p->host,non_ident, &client_p->localClient->ip, client_p->localClient->aftype, client_p->localClient->passwd); } if (conf != NULL) { if (IsConfClient(conf)) { if (IsConfRedir(conf)) { sendto_one(client_p, form_str(RPL_REDIR), me.name, client_p->name, conf->name ? conf->name : "", conf->port); return NOT_AUTHORIZED; } if (IsConfDoIdentd(conf)) SetNeedId(client_p); /* Thanks for spoof idea amm */ if (IsConfDoSpoofIp(conf)) { if (!ConfigFileEntry.hide_spoof_ips && IsConfSpoofNotice(conf)) sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "%s spoofing: %s as %s", client_p->name, client_p->host, conf->name); strlcpy(client_p->host, conf->name, sizeof(client_p->host)); AddFlag(client_p, FLAGS_IP_SPOOFING | FLAGS_AUTH_SPOOF); } return attach_iline(client_p, conf); } else if (IsConfKill(conf) || (ConfigFileEntry.glines && IsConfGline(conf))) { if (IsConfGline(conf)) sendto_one(client_p, ":%s NOTICE %s :*** G-lined", me.name, client_p->name); sendto_one(client_p, ":%s NOTICE %s :*** Banned: %s", me.name, client_p->name, conf->reason); return BANNED_CLIENT; } } return NOT_AUTHORIZED; } /* attach_iline() * * inputs - client pointer * - conf pointer * output - * side effects - do actual attach */ static int attach_iline(struct Client *client_p, struct MaskItem *conf) { struct ClassItem *class = NULL; struct ip_entry *ip_found; int a_limit_reached = 0; unsigned int local = 0, global = 0, ident = 0; assert(conf->class); ip_found = find_or_add_ip(&client_p->localClient->ip); ip_found->count++; SetIpHash(client_p); class = conf->class; count_user_host(client_p->username, client_p->host, &global, &local, &ident); /* XXX blah. go down checking the various silly limits * setting a_limit_reached if any limit is reached. * - Dianora */ if (class->max_total != 0 && class->ref_count >= class->max_total) a_limit_reached = 1; else if (class->max_perip != 0 && ip_found->count > class->max_perip) a_limit_reached = 1; else if (class->max_local != 0 && local >= class->max_local) a_limit_reached = 1; else if (class->max_global != 0 && global >= class->max_global) a_limit_reached = 1; else if (class->max_ident != 0 && ident >= class->max_ident && client_p->username[0] != '~') a_limit_reached = 1; if (a_limit_reached) { if (!IsConfExemptLimits(conf)) return TOO_MANY; /* Already at maximum allowed */ sendto_one(client_p, ":%s NOTICE %s :*** Your connection class is full, " "but you have exceed_limit = yes;", me.name, client_p->name); } return attach_conf(client_p, conf); } /* init_ip_hash_table() * * inputs - NONE * output - NONE * side effects - allocate memory for ip_entry(s) * - clear the ip hash table */ void init_ip_hash_table(void) { ip_entry_pool = mp_pool_new(sizeof(struct ip_entry), MP_CHUNK_SIZE_IP_ENTRY); memset(ip_hash_table, 0, sizeof(ip_hash_table)); } /* find_or_add_ip() * * inputs - pointer to struct irc_ssaddr * output - pointer to a struct ip_entry * side effects - * * If the ip # was not found, a new struct ip_entry is created, and the ip * count set to 0. */ static struct ip_entry * find_or_add_ip(struct irc_ssaddr *ip_in) { struct ip_entry *ptr, *newptr; int hash_index = hash_ip(ip_in), res; struct sockaddr_in *v4 = (struct sockaddr_in *)ip_in, *ptr_v4; #ifdef IPV6 struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)ip_in, *ptr_v6; #endif for (ptr = ip_hash_table[hash_index]; ptr; ptr = ptr->next) { #ifdef IPV6 if (ptr->ip.ss.ss_family != ip_in->ss.ss_family) continue; if (ip_in->ss.ss_family == AF_INET6) { ptr_v6 = (struct sockaddr_in6 *)&ptr->ip; res = memcmp(&v6->sin6_addr, &ptr_v6->sin6_addr, sizeof(struct in6_addr)); } else #endif { ptr_v4 = (struct sockaddr_in *)&ptr->ip; res = memcmp(&v4->sin_addr, &ptr_v4->sin_addr, sizeof(struct in_addr)); } if (res == 0) { /* Found entry already in hash, return it. */ return ptr; } } if (ip_entries_count >= 2 * hard_fdlimit) garbage_collect_ip_entries(); newptr = mp_pool_get(ip_entry_pool); memset(newptr, 0, sizeof(*newptr)); ip_entries_count++; memcpy(&newptr->ip, ip_in, sizeof(struct irc_ssaddr)); newptr->next = ip_hash_table[hash_index]; ip_hash_table[hash_index] = newptr; return newptr; } /* remove_one_ip() * * inputs - unsigned long IP address value * output - NONE * side effects - The ip address given, is looked up in ip hash table * and number of ip#'s for that ip decremented. * If ip # count reaches 0 and has expired, * the struct ip_entry is returned to the ip_entry_heap */ void remove_one_ip(struct irc_ssaddr *ip_in) { struct ip_entry *ptr; struct ip_entry *last_ptr = NULL; int hash_index = hash_ip(ip_in), res; struct sockaddr_in *v4 = (struct sockaddr_in *)ip_in, *ptr_v4; #ifdef IPV6 struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)ip_in, *ptr_v6; #endif for (ptr = ip_hash_table[hash_index]; ptr; ptr = ptr->next) { #ifdef IPV6 if (ptr->ip.ss.ss_family != ip_in->ss.ss_family) continue; if (ip_in->ss.ss_family == AF_INET6) { ptr_v6 = (struct sockaddr_in6 *)&ptr->ip; res = memcmp(&v6->sin6_addr, &ptr_v6->sin6_addr, sizeof(struct in6_addr)); } else #endif { ptr_v4 = (struct sockaddr_in *)&ptr->ip; res = memcmp(&v4->sin_addr, &ptr_v4->sin_addr, sizeof(struct in_addr)); } if (res) continue; if (ptr->count > 0) ptr->count--; if (ptr->count == 0 && (CurrentTime-ptr->last_attempt) >= ConfigFileEntry.throttle_time) { if (last_ptr != NULL) last_ptr->next = ptr->next; else ip_hash_table[hash_index] = ptr->next; mp_pool_release(ptr); ip_entries_count--; return; } last_ptr = ptr; } } /* hash_ip() * * input - pointer to an irc_inaddr * output - integer value used as index into hash table * side effects - hopefully, none */ static int hash_ip(struct irc_ssaddr *addr) { if (addr->ss.ss_family == AF_INET) { struct sockaddr_in *v4 = (struct sockaddr_in *)addr; int hash; uint32_t ip; ip = ntohl(v4->sin_addr.s_addr); hash = ((ip >> 12) + ip) & (IP_HASH_SIZE-1); return hash; } #ifdef IPV6 else { int hash; struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr; uint32_t *ip = (uint32_t *)&v6->sin6_addr.s6_addr; hash = ip[0] ^ ip[3]; hash ^= hash >> 16; hash ^= hash >> 8; hash = hash & (IP_HASH_SIZE - 1); return hash; } #else return 0; #endif } /* count_ip_hash() * * inputs - pointer to counter of number of ips hashed * - pointer to memory used for ip hash * output - returned via pointers input * side effects - NONE * * number of hashed ip #'s is counted up, plus the amount of memory * used in the hash. */ void count_ip_hash(unsigned int *number_ips_stored, uint64_t *mem_ips_stored) { struct ip_entry *ptr; int i; *number_ips_stored = 0; *mem_ips_stored = 0; for (i = 0; i < IP_HASH_SIZE; i++) { for (ptr = ip_hash_table[i]; ptr; ptr = ptr->next) { *number_ips_stored += 1; *mem_ips_stored += sizeof(struct ip_entry); } } } /* garbage_collect_ip_entries() * * input - NONE * output - NONE * side effects - free up all ip entries with no connections */ static void garbage_collect_ip_entries(void) { struct ip_entry *ptr; struct ip_entry *last_ptr; struct ip_entry *next_ptr; int i; for (i = 0; i < IP_HASH_SIZE; i++) { last_ptr = NULL; for (ptr = ip_hash_table[i]; ptr; ptr = next_ptr) { next_ptr = ptr->next; if (ptr->count == 0 && (CurrentTime - ptr->last_attempt) >= ConfigFileEntry.throttle_time) { if (last_ptr != NULL) last_ptr->next = ptr->next; else ip_hash_table[i] = ptr->next; mp_pool_release(ptr); ip_entries_count--; } else last_ptr = ptr; } } } /* detach_conf() * * inputs - pointer to client to detach * - type of conf to detach * output - 0 for success, -1 for failure * side effects - Disassociate configuration from the client. * Also removes a class from the list if marked for deleting. */ void detach_conf(struct Client *client_p, enum maskitem_type type) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->confs.head) { struct MaskItem *conf = ptr->data; assert(conf->type & (CONF_CLIENT | CONF_OPER | CONF_SERVER)); assert(conf->ref_count > 0); assert(conf->class->ref_count > 0); if (!(conf->type & type)) continue; dlinkDelete(ptr, &client_p->localClient->confs); free_dlink_node(ptr); if (conf->type == CONF_CLIENT) remove_from_cidr_check(&client_p->localClient->ip, conf->class); if (--conf->class->ref_count == 0 && conf->class->active == 0) { class_free(conf->class); conf->class = NULL; } if (--conf->ref_count == 0 && conf->active == 0) conf_free(conf); } } /* attach_conf() * * inputs - client pointer * - conf pointer * output - * side effects - Associate a specific configuration entry to a *local* * client (this is the one which used in accepting the * connection). Note, that this automatically changes the * attachment if there was an old one... */ int attach_conf(struct Client *client_p, struct MaskItem *conf) { if (dlinkFind(&client_p->localClient->confs, conf) != NULL) return 1; if (conf->type == CONF_CLIENT) if (cidr_limit_reached(IsConfExemptLimits(conf), &client_p->localClient->ip, conf->class)) return TOO_MANY; /* Already at maximum allowed */ conf->class->ref_count++; conf->ref_count++; dlinkAdd(conf, make_dlink_node(), &client_p->localClient->confs); return 0; } /* attach_connect_block() * * inputs - pointer to server to attach * - name of server * - hostname of server * output - true (1) if both are found, otherwise return false (0) * side effects - find connect block and attach them to connecting client */ int attach_connect_block(struct Client *client_p, const char *name, const char *host) { dlink_node *ptr; struct MaskItem *conf = NULL; assert(client_p != NULL); assert(host != NULL); if (client_p == NULL || host == NULL) return 0; DLINK_FOREACH(ptr, server_items.head) { conf = ptr->data; if (match(conf->name, name) || match(conf->host, host)) continue; attach_conf(client_p, conf); return -1; } return 0; } /* find_conf_name() * * inputs - pointer to conf link list to search * - pointer to name to find * - int mask of type of conf to find * output - NULL or pointer to conf found * side effects - find a conf entry which matches the name * and has the given mask. */ struct MaskItem * find_conf_name(dlink_list *list, const char *name, enum maskitem_type type) { dlink_node *ptr; struct MaskItem* conf; DLINK_FOREACH(ptr, list->head) { conf = ptr->data; if (conf->type == type) { if (conf->name && (irccmp(conf->name, name) == 0 || !match(conf->name, name))) return conf; } } return NULL; } /* map_to_list() * * inputs - ConfType conf * output - pointer to dlink_list to use * side effects - none */ static dlink_list * map_to_list(enum maskitem_type type) { switch(type) { case CONF_XLINE: return(&xconf_items); break; case CONF_ULINE: return(&uconf_items); break; case CONF_NRESV: return(&nresv_items); break; case CONF_CRESV: return(&cresv_items); case CONF_OPER: return(&oconf_items); break; case CONF_SERVER: return(&server_items); break; case CONF_SERVICE: return(&service_items); break; case CONF_CLUSTER: return(&cluster_items); break; default: return NULL; } } /* find_matching_name_conf() * * inputs - type of link list to look in * - pointer to name string to find * - pointer to user * - pointer to host * - optional flags to match on as well * output - NULL or pointer to found struct MaskItem * side effects - looks for a match on name field */ struct MaskItem * find_matching_name_conf(enum maskitem_type type, const char *name, const char *user, const char *host, unsigned int flags) { dlink_node *ptr=NULL; struct MaskItem *conf=NULL; dlink_list *list_p = map_to_list(type); switch (type) { case CONF_SERVICE: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if (EmptyString(conf->name)) continue; if ((name != NULL) && !irccmp(name, conf->name)) return conf; } break; case CONF_XLINE: case CONF_ULINE: case CONF_NRESV: case CONF_CRESV: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if (EmptyString(conf->name)) continue; if ((name != NULL) && !match(conf->name, name)) { if ((user == NULL && (host == NULL))) return conf; if ((conf->flags & flags) != flags) continue; if (EmptyString(conf->user) || EmptyString(conf->host)) return conf; if (!match(conf->user, user) && !match(conf->host, host)) return conf; } } break; case CONF_SERVER: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if ((name != NULL) && !match(name, conf->name)) return conf; else if ((host != NULL) && !match(host, conf->host)) return conf; } break; default: break; } return NULL; } /* find_exact_name_conf() * * inputs - type of link list to look in * - pointer to name string to find * - pointer to user * - pointer to host * output - NULL or pointer to found struct MaskItem * side effects - looks for an exact match on name field */ struct MaskItem * find_exact_name_conf(enum maskitem_type type, const struct Client *who, const char *name, const char *user, const char *host) { dlink_node *ptr = NULL; struct MaskItem *conf; dlink_list *list_p = map_to_list(type); switch(type) { case CONF_XLINE: case CONF_ULINE: case CONF_NRESV: case CONF_CRESV: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if (EmptyString(conf->name)) continue; if (irccmp(conf->name, name) == 0) { if ((user == NULL && (host == NULL))) return conf; if (EmptyString(conf->user) || EmptyString(conf->host)) return conf; if (!match(conf->user, user) && !match(conf->host, host)) return conf; } } break; case CONF_OPER: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if (EmptyString(conf->name)) continue; if (!irccmp(conf->name, name)) { if (!who) return conf; if (EmptyString(conf->user) || EmptyString(conf->host)) return NULL; if (!match(conf->user, who->username)) { switch (conf->htype) { case HM_HOST: if (!match(conf->host, who->host) || !match(conf->host, who->sockhost)) if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) return conf; break; case HM_IPV4: if (who->localClient->aftype == AF_INET) if (match_ipv4(&who->localClient->ip, &conf->addr, conf->bits)) if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) return conf; break; #ifdef IPV6 case HM_IPV6: if (who->localClient->aftype == AF_INET6) if (match_ipv6(&who->localClient->ip, &conf->addr, conf->bits)) if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) return conf; break; #endif default: assert(0); } } } } break; case CONF_SERVER: DLINK_FOREACH(ptr, list_p->head) { conf = ptr->data; if (EmptyString(conf->name)) continue; if (name == NULL) { if (EmptyString(conf->host)) continue; if (irccmp(conf->host, host) == 0) return conf; } else if (irccmp(conf->name, name) == 0) return conf; } break; default: break; } return NULL; } /* rehash() * * Actual REHASH service routine. Called with sig == 0 if it has been called * as a result of an operator issuing this command, else assume it has been * called as a result of the server receiving a HUP signal. */ int rehash(int sig) { if (sig != 0) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Got signal SIGHUP, reloading ircd.conf file"); restart_resolver(); /* don't close listeners until we know we can go ahead with the rehash */ /* Check to see if we magically got(or lost) IPv6 support */ check_can_use_v6(); read_conf_files(0); if (ServerInfo.description != NULL) strlcpy(me.info, ServerInfo.description, sizeof(me.info)); load_conf_modules(); rehashed_klines = 1; return 0; } /* set_default_conf() * * inputs - NONE * output - NONE * side effects - Set default values here. * This is called **PRIOR** to parsing the * configuration file. If you want to do some validation * of values later, put them in validate_conf(). */ static void set_default_conf(void) { /* verify init_class() ran, this should be an unnecessary check * but its not much work. */ assert(class_default == class_get_list()->tail->data); #ifdef HAVE_LIBCRYPTO ServerInfo.rsa_private_key = NULL; ServerInfo.rsa_private_key_file = NULL; #endif /* ServerInfo.name is not rehashable */ /* ServerInfo.name = ServerInfo.name; */ ServerInfo.description = NULL; ServerInfo.network_name = xstrdup(NETWORK_NAME_DEFAULT); ServerInfo.network_desc = xstrdup(NETWORK_DESC_DEFAULT); memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip)); ServerInfo.specific_ipv4_vhost = 0; memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6)); ServerInfo.specific_ipv6_vhost = 0; ServerInfo.max_clients = MAXCLIENTS_MAX; ServerInfo.max_nick_length = 9; ServerInfo.max_topic_length = 80; ServerInfo.hub = 0; ServerInfo.dns_host.sin_addr.s_addr = 0; ServerInfo.dns_host.sin_port = 0; AdminInfo.name = NULL; AdminInfo.email = NULL; AdminInfo.description = NULL; log_del_all(); ConfigLoggingEntry.use_logging = 1; ConfigChannel.disable_fake_channels = 0; ConfigChannel.knock_delay = 300; ConfigChannel.knock_delay_channel = 60; ConfigChannel.max_chans_per_user = 25; ConfigChannel.max_chans_per_oper = 50; ConfigChannel.max_bans = 25; ConfigChannel.default_split_user_count = 0; ConfigChannel.default_split_server_count = 0; ConfigChannel.no_join_on_split = 0; ConfigChannel.no_create_on_split = 0; ConfigServerHide.flatten_links = 0; ConfigServerHide.links_delay = 300; ConfigServerHide.hidden = 0; ConfigServerHide.hide_servers = 0; ConfigServerHide.hide_services = 0; ConfigServerHide.hidden_name = xstrdup(NETWORK_NAME_DEFAULT); ConfigServerHide.hide_server_ips = 0; ConfigServerHide.disable_remote_commands = 0; ConfigFileEntry.service_name = xstrdup(SERVICE_NAME_DEFAULT); ConfigFileEntry.max_watch = WATCHSIZE_DEFAULT; ConfigFileEntry.cycle_on_host_change = 1; ConfigFileEntry.glines = 0; ConfigFileEntry.gline_time = 12 * 3600; ConfigFileEntry.gline_request_time = GLINE_REQUEST_EXPIRE_DEFAULT; ConfigFileEntry.gline_min_cidr = 16; ConfigFileEntry.gline_min_cidr6 = 48; ConfigFileEntry.invisible_on_connect = 1; ConfigFileEntry.tkline_expire_notices = 1; ConfigFileEntry.hide_spoof_ips = 1; ConfigFileEntry.ignore_bogus_ts = 0; ConfigFileEntry.disable_auth = 0; ConfigFileEntry.kill_chase_time_limit = 90; ConfigFileEntry.default_floodcount = 8; ConfigFileEntry.failed_oper_notice = 1; ConfigFileEntry.dots_in_ident = 0; ConfigFileEntry.min_nonwildcard = 4; ConfigFileEntry.min_nonwildcard_simple = 3; ConfigFileEntry.max_accept = 20; ConfigFileEntry.anti_nick_flood = 0; ConfigFileEntry.max_nick_time = 20; ConfigFileEntry.max_nick_changes = 5; ConfigFileEntry.anti_spam_exit_message_time = 0; ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; ConfigFileEntry.warn_no_nline = 1; ConfigFileEntry.stats_o_oper_only = 0; ConfigFileEntry.stats_k_oper_only = 1; /* masked */ ConfigFileEntry.stats_i_oper_only = 1; /* masked */ ConfigFileEntry.stats_P_oper_only = 0; ConfigFileEntry.stats_u_oper_only = 0; ConfigFileEntry.caller_id_wait = 60; ConfigFileEntry.opers_bypass_callerid = 0; ConfigFileEntry.pace_wait = 10; ConfigFileEntry.pace_wait_simple = 1; ConfigFileEntry.short_motd = 0; ConfigFileEntry.ping_cookie = 0; ConfigFileEntry.no_oper_flood = 0; ConfigFileEntry.true_no_oper_flood = 0; ConfigFileEntry.oper_pass_resv = 1; ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT; ConfigFileEntry.oper_only_umodes = UMODE_DEBUG; ConfigFileEntry.oper_umodes = UMODE_BOTS | UMODE_LOCOPS | UMODE_SERVNOTICE | UMODE_OPERWALL | UMODE_WALLOP; ConfigFileEntry.use_egd = 0; ConfigFileEntry.egdpool_path = NULL; ConfigFileEntry.throttle_time = 10; } static void validate_conf(void) { if (ConfigFileEntry.ts_warn_delta < TS_WARN_DELTA_MIN) ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT; if (ConfigFileEntry.ts_max_delta < TS_MAX_DELTA_MIN) ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT; if (ServerInfo.network_name == NULL) ServerInfo.network_name = xstrdup(NETWORK_NAME_DEFAULT); if (ServerInfo.network_desc == NULL) ServerInfo.network_desc = xstrdup(NETWORK_DESC_DEFAULT); if (ConfigFileEntry.service_name == NULL) ConfigFileEntry.service_name = xstrdup(SERVICE_NAME_DEFAULT); ConfigFileEntry.max_watch = IRCD_MAX(ConfigFileEntry.max_watch, WATCHSIZE_MIN); } /* read_conf() * * inputs - file descriptor pointing to config file to use * output - None * side effects - Read configuration file. */ static void read_conf(FILE *file) { lineno = 0; set_default_conf(); /* Set default values prior to conf parsing */ conf_parser_ctx.pass = 1; yyparse(); /* pick up the classes first */ rewind(file); conf_parser_ctx.pass = 2; yyparse(); /* Load the values from the conf */ validate_conf(); /* Check to make sure some values are still okay. */ /* Some global values are also loaded here. */ class_delete_marked(); /* Make sure classes are valid */ } /* lookup_confhost() * * start DNS lookups of all hostnames in the conf * line and convert an IP addresses in a.b.c.d number for to IP#s. */ void lookup_confhost(struct MaskItem *conf) { struct addrinfo hints, *res; /* Do name lookup now on hostnames given and store the * ip numbers in conf structure. */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; /* Get us ready for a bind() and don't bother doing dns lookup */ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(conf->host, NULL, &hints, &res)) { conf_dns_lookup(conf); return; } assert(res != NULL); memcpy(&conf->addr, res->ai_addr, res->ai_addrlen); conf->addr.ss_len = res->ai_addrlen; conf->addr.ss.ss_family = res->ai_family; freeaddrinfo(res); } /* conf_connect_allowed() * * inputs - pointer to inaddr * - int type ipv4 or ipv6 * output - BANNED or accepted * side effects - none */ int conf_connect_allowed(struct irc_ssaddr *addr, int aftype) { struct ip_entry *ip_found; struct MaskItem *conf = find_dline_conf(addr, aftype); /* DLINE exempt also gets you out of static limits/pacing... */ if (conf && (conf->type == CONF_EXEMPT)) return 0; if (conf != NULL) return BANNED_CLIENT; ip_found = find_or_add_ip(addr); if ((CurrentTime - ip_found->last_attempt) < ConfigFileEntry.throttle_time) { ip_found->last_attempt = CurrentTime; return TOO_FAST; } ip_found->last_attempt = CurrentTime; return 0; } /* cleanup_tklines() * * inputs - NONE * output - NONE * side effects - call function to expire temporary k/d lines * This is an event started off in ircd.c */ void cleanup_tklines(void *notused) { hostmask_expire_temporary(); expire_tklines(&xconf_items); expire_tklines(&nresv_items); expire_tklines(&cresv_items); } /* expire_tklines() * * inputs - tkline list pointer * output - NONE * side effects - expire tklines */ static void expire_tklines(dlink_list *tklist) { dlink_node *ptr; dlink_node *next_ptr; struct MaskItem *conf; DLINK_FOREACH_SAFE(ptr, next_ptr, tklist->head) { conf = ptr->data; if (!conf->until || conf->until > CurrentTime) continue; if (conf->type == CONF_XLINE) { if (ConfigFileEntry.tkline_expire_notices) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Temporary X-line for [%s] expired", conf->name); conf_free(conf); } else if (conf->type == CONF_NRESV || conf->type == CONF_CRESV) { if (ConfigFileEntry.tkline_expire_notices) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Temporary RESV for [%s] expired", conf->name); conf_free(conf); } } } /* oper_privs_as_string() * * inputs - pointer to client_p * output - pointer to static string showing oper privs * side effects - return as string, the oper privs as derived from port */ static const struct oper_privs { const unsigned int flag; const unsigned char c; } flag_list[] = { { OPER_FLAG_ADMIN, 'A' }, { OPER_FLAG_REMOTEBAN, 'B' }, { OPER_FLAG_DIE, 'D' }, { OPER_FLAG_GLINE, 'G' }, { OPER_FLAG_REHASH, 'H' }, { OPER_FLAG_K, 'K' }, { OPER_FLAG_OPERWALL, 'L' }, { OPER_FLAG_KILL, 'N' }, { OPER_FLAG_KILL_REMOTE, 'O' }, { OPER_FLAG_CONNECT, 'P' }, { OPER_FLAG_CONNECT_REMOTE, 'Q' }, { OPER_FLAG_SQUIT, 'R' }, { OPER_FLAG_SQUIT_REMOTE, 'S' }, { OPER_FLAG_UNKLINE, 'U' }, { OPER_FLAG_X, 'X' }, { 0, '\0' } }; char * oper_privs_as_string(const unsigned int port) { static char privs_out[IRCD_BUFSIZE]; char *privs_ptr = privs_out; const struct oper_privs *opriv = flag_list; for (; opriv->flag; ++opriv) { if (port & opriv->flag) *privs_ptr++ = opriv->c; else *privs_ptr++ = ToLower(opriv->c); } *privs_ptr = '\0'; return privs_out; } /* * Input: A client to find the active oper{} name for. * Output: The nick!user@host{oper} of the oper. * "oper" is server name for remote opers * Side effects: None. */ const char * get_oper_name(const struct Client *client_p) { dlink_node *cnode = NULL; /* +5 for !,@,{,} and null */ static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5]; if (MyConnect(client_p)) { if ((cnode = client_p->localClient->confs.head)) { struct MaskItem *conf = cnode->data; if (IsConfOperator(conf)) { snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name, client_p->username, client_p->host, conf->name); return buffer; } } /* Probably should assert here for now. If there is an oper out there * with no oper{} conf attached, it would be good for us to know... */ assert(0); /* Oper without oper conf! */ } snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}", client_p->name, client_p->username, client_p->host, client_p->servptr->name); return buffer; } /* read_conf_files() * * inputs - cold start YES or NO * output - none * side effects - read all conf files needed, ircd.conf kline.conf etc. */ void read_conf_files(int cold) { const char *filename; char chanmodes[IRCD_BUFSIZE]; char chanlimit[IRCD_BUFSIZE]; conf_parser_ctx.boot = cold; filename = ConfigFileEntry.configfile; /* We need to know the initial filename for the yyerror() to report FIXME: The full path is in conffilenamebuf first time since we dont know anything else - Gozem 2002-07-21 */ strlcpy(conffilebuf, filename, sizeof(conffilebuf)); if ((conf_parser_ctx.conf_file = fopen(filename, "r")) == NULL) { if (cold) { ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", filename, strerror(errno)); exit(-1); } else { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Unable to read configuration file '%s': %s", filename, strerror(errno)); return; } } if (!cold) clear_out_old_conf(); read_conf(conf_parser_ctx.conf_file); fclose(conf_parser_ctx.conf_file); log_reopen_all(); add_isupport("NICKLEN", NULL, ServerInfo.max_nick_length); add_isupport("NETWORK", ServerInfo.network_name, -1); snprintf(chanmodes, sizeof(chanmodes), "beI:%d", ConfigChannel.max_bans); add_isupport("MAXLIST", chanmodes, -1); add_isupport("MAXTARGETS", NULL, ConfigFileEntry.max_targets); add_isupport("CHANTYPES", "#", -1); snprintf(chanlimit, sizeof(chanlimit), "#:%d", ConfigChannel.max_chans_per_user); add_isupport("CHANLIMIT", chanlimit, -1); snprintf(chanmodes, sizeof(chanmodes), "%s", "beI,k,l,imnprstORS"); add_isupport("CHANNELLEN", NULL, LOCAL_CHANNELLEN); add_isupport("TOPICLEN", NULL, ServerInfo.max_topic_length); add_isupport("CHANMODES", chanmodes, -1); /* * message_locale may have changed. rebuild isupport since it relies * on strlen(form_str(RPL_ISUPPORT)) */ rebuild_isupport_message_line(); } /* clear_out_old_conf() * * inputs - none * output - none * side effects - Clear out the old configuration */ static void clear_out_old_conf(void) { dlink_node *ptr = NULL, *next_ptr = NULL; struct MaskItem *conf; dlink_list *free_items [] = { &server_items, &oconf_items, &uconf_items, &xconf_items, &nresv_items, &cluster_items, &service_items, &cresv_items, NULL }; dlink_list ** iterator = free_items; /* C is dumb */ /* We only need to free anything allocated by yyparse() here. * Resetting structs, etc, is taken care of by set_default_conf(). */ for (; *iterator != NULL; iterator++) { DLINK_FOREACH_SAFE(ptr, next_ptr, (*iterator)->head) { conf = ptr->data; dlinkDelete(&conf->node, map_to_list(conf->type)); /* XXX This is less than pretty */ if (conf->type == CONF_SERVER || conf->type == CONF_OPER) { if (!conf->ref_count) conf_free(conf); } else if (conf->type == CONF_XLINE) { if (!conf->until) conf_free(conf); } else conf_free(conf); } } motd_clear(); /* * don't delete the class table, rather mark all entries * for deletion. The table is cleaned up by class_delete_marked. - avalon */ class_mark_for_deletion(); clear_out_address_conf(); /* clean out module paths */ mod_clear_paths(); /* clean out ServerInfo */ MyFree(ServerInfo.description); ServerInfo.description = NULL; MyFree(ServerInfo.network_name); ServerInfo.network_name = NULL; MyFree(ServerInfo.network_desc); ServerInfo.network_desc = NULL; MyFree(ConfigFileEntry.egdpool_path); ConfigFileEntry.egdpool_path = NULL; #ifdef HAVE_LIBCRYPTO if (ServerInfo.rsa_private_key != NULL) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; } MyFree(ServerInfo.rsa_private_key_file); ServerInfo.rsa_private_key_file = NULL; if (ServerInfo.server_ctx) SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2| SSL_OP_NO_SSLv3| SSL_OP_NO_TLSv1); if (ServerInfo.client_ctx) SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv2| SSL_OP_NO_SSLv3| SSL_OP_NO_TLSv1); #endif /* clean out AdminInfo */ MyFree(AdminInfo.name); AdminInfo.name = NULL; MyFree(AdminInfo.email); AdminInfo.email = NULL; MyFree(AdminInfo.description); AdminInfo.description = NULL; /* clean out listeners */ close_listeners(); /* clean out general */ MyFree(ConfigFileEntry.service_name); ConfigFileEntry.service_name = NULL; } /* conf_add_class_to_conf() * * inputs - pointer to config item * output - NONE * side effects - Add a class pointer to a conf */ void conf_add_class_to_conf(struct MaskItem *conf, const char *class_name) { if (class_name == NULL) { conf->class = class_default; if (conf->type == CONF_CLIENT) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning *** Defaulting to default class for %s@%s", conf->user, conf->host); else sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning *** Defaulting to default class for %s", conf->name); } else conf->class = class_find(class_name, 1); if (conf->class == NULL) { if (conf->type == CONF_CLIENT) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning *** Defaulting to default class for %s@%s", conf->user, conf->host); else sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning *** Defaulting to default class for %s", conf->name); conf->class = class_default; } } /* yyerror() * * inputs - message from parser * output - NONE * side effects - message to opers and log file entry is made */ void yyerror(const char *msg) { char newlinebuf[IRCD_BUFSIZE]; if (conf_parser_ctx.pass != 1) return; strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "\"%s\", line %u: %s: %s", conffilebuf, lineno + 1, msg, newlinebuf); ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", conffilebuf, lineno + 1, msg, newlinebuf); } void conf_error_report(const char *msg) { char newlinebuf[IRCD_BUFSIZE]; strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "\"%s\", line %u: %s: %s", conffilebuf, lineno + 1, msg, newlinebuf); ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s", conffilebuf, lineno + 1, msg, newlinebuf); } /* * valid_tkline() * * inputs - pointer to ascii string to check * - whether the specified time is in seconds or minutes * output - -1 not enough parameters * - 0 if not an integer number, else the number * side effects - none * Originally written by Dianora (Diane, db@db.net) */ time_t valid_tkline(const char *data, const int minutes) { const unsigned char *p = (const unsigned char *)data; unsigned char tmpch = '\0'; time_t result = 0; while ((tmpch = *p++)) { if (!IsDigit(tmpch)) return 0; result *= 10; result += (tmpch & 0xF); } /* * In the degenerate case where oper does a /quote kline 0 user@host :reason * i.e. they specifically use 0, I am going to return 1 instead * as a return value of non-zero is used to flag it as a temporary kline */ if (result == 0) result = 1; /* * If the incoming time is in seconds convert it to minutes for the purpose * of this calculation */ if (!minutes) result = result / 60; if (result > MAX_TDKLINE_TIME) result = MAX_TDKLINE_TIME; result = result * 60; /* turn it into seconds */ return result; } /* valid_wild_card_simple() * * inputs - data to check for sufficient non-wildcard characters * outputs - 1 if valid, else 0 * side effects - none */ int valid_wild_card_simple(const char *data) { const unsigned char *p = (const unsigned char *)data; unsigned char tmpch = '\0'; int nonwild = 0; while ((tmpch = *p++)) { if (tmpch == '\\') { ++p; if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) return 1; } else if (!IsMWildChar(tmpch)) { if (++nonwild >= ConfigFileEntry.min_nonwildcard_simple) return 1; } } return 0; } /* valid_wild_card() * * input - pointer to client * - int flag, 0 for no warning oper 1 for warning oper * - count of following varargs to check * output - 0 if not valid, 1 if valid * side effects - NOTICE is given to source_p if warn is 1 */ int valid_wild_card(struct Client *source_p, int warn, int count, ...) { char tmpch; int nonwild = 0; va_list args; /* * Now we must check the user and host to make sure there * are at least NONWILDCHARS non-wildcard characters in * them, otherwise assume they are attempting to kline * *@* or some variant of that. This code will also catch * people attempting to kline *@*.tld, as long as NONWILDCHARS * is greater than 3. In that case, there are only 3 non-wild * characters (tld), so if NONWILDCHARS is 4, the kline will * be disallowed. * -wnder */ va_start(args, count); while (count--) { const char *p = va_arg(args, const char *); if (p == NULL) continue; while ((tmpch = *p++)) { if (!IsKWildChar(tmpch)) { /* * If we find enough non-wild characters, we can * break - no point in searching further. */ if (++nonwild >= ConfigFileEntry.min_nonwildcard) { va_end(args); return 1; } } } } if (warn) sendto_one(source_p, ":%s NOTICE %s :Please include at least %d non-wildcard characters with the mask", me.name, source_p->name, ConfigFileEntry.min_nonwildcard); va_end(args); return 0; } /* XXX should this go into a separate file ? -Dianora */ /* parse_aline * * input - pointer to cmd name being used * - pointer to client using cmd * - parc parameter count * - parv[] list of parameters to parse * - parse_flags bit map of things to test * - pointer to user or string to parse into * - pointer to host or NULL to parse into if non NULL * - pointer to optional tkline time or NULL * - pointer to target_server to parse into if non NULL * - pointer to reason to parse into * * output - 1 if valid, -1 if not valid * side effects - A generalised k/d/x etc. line parser, * "ALINE [time] user@host|string [ON] target :reason" * will parse returning a parsed user, host if * h_p pointer is non NULL, string otherwise. * if tkline_time pointer is non NULL a tk line will be set * to non zero if found. * if tkline_time pointer is NULL and tk line is found, * error is reported. * if target_server is NULL and an "ON" is found error * is reported. * if reason pointer is NULL ignore pointer, * this allows use of parse_a_line in unkline etc. * * - Dianora */ int parse_aline(const char *cmd, struct Client *source_p, int parc, char **parv, int parse_flags, char **up_p, char **h_p, time_t *tkline_time, char **target_server, char **reason) { int found_tkline_time=0; static char def_reason[] = "No Reason"; static char user[USERLEN*4+1]; static char host[HOSTLEN*4+1]; parv++; parc--; found_tkline_time = valid_tkline(*parv, TK_MINUTES); if (found_tkline_time != 0) { parv++; parc--; if (tkline_time != NULL) *tkline_time = found_tkline_time; else { sendto_one(source_p, ":%s NOTICE %s :temp_line not supported by %s", me.name, source_p->name, cmd); return -1; } } if (parc == 0) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, cmd); return -1; } if (h_p == NULL) *up_p = *parv; else { if (find_user_host(source_p, *parv, user, host, parse_flags) == 0) return -1; *up_p = user; *h_p = host; } parc--; parv++; if (parc != 0) { if (irccmp(*parv, "ON") == 0) { parc--; parv++; if (target_server == NULL) { sendto_one(source_p, ":%s NOTICE %s :ON server not supported by %s", me.name, source_p->name, cmd); return -1; } if (!HasOFlag(source_p, OPER_FLAG_REMOTEBAN)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "remoteban"); return -1; } if (parc == 0 || EmptyString(*parv)) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, cmd); return -1; } *target_server = *parv; parc--; parv++; } else { /* Make sure target_server *is* NULL if no ON server found * caller probably NULL'd it first, but no harm to do it again -db */ if (target_server != NULL) *target_server = NULL; } } if (h_p != NULL) { if (strchr(user, '!') != NULL) { sendto_one(source_p, ":%s NOTICE %s :Invalid character '!' in kline", me.name, source_p->name); return -1; } if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 2, *up_p, *h_p)) return -1; } else if ((parse_flags & AWILD) && !valid_wild_card(source_p, 1, 1, *up_p)) return -1; if (reason != NULL) { if (parc != 0 && !EmptyString(*parv)) { *reason = *parv; if (!valid_comment(source_p, *reason, 1)) return -1; } else *reason = def_reason; } return 1; } /* find_user_host() * * inputs - pointer to client placing kline * - pointer to user_host_or_nick * - pointer to user buffer * - pointer to host buffer * output - 0 if not ok to kline, 1 to kline i.e. if valid user host * side effects - */ static int find_user_host(struct Client *source_p, char *user_host_or_nick, char *luser, char *lhost, unsigned int flags) { struct Client *target_p = NULL; char *hostp = NULL; if (lhost == NULL) { strlcpy(luser, user_host_or_nick, USERLEN*4 + 1); return 1; } if ((hostp = strchr(user_host_or_nick, '@')) || *user_host_or_nick == '*') { /* Explicit user@host mask given */ if (hostp != NULL) /* I'm a little user@host */ { *(hostp++) = '\0'; /* short and squat */ if (*user_host_or_nick) strlcpy(luser, user_host_or_nick, USERLEN*4 + 1); /* here is my user */ else strcpy(luser, "*"); if (*hostp) strlcpy(lhost, hostp, HOSTLEN + 1); /* here is my host */ else strcpy(lhost, "*"); } else { luser[0] = '*'; /* no @ found, assume its *@somehost */ luser[1] = '\0'; strlcpy(lhost, user_host_or_nick, HOSTLEN*4 + 1); } return 1; } else { /* Try to find user@host mask from nick */ /* Okay to use source_p as the first param, because source_p == client_p */ if ((target_p = find_chasing(source_p, user_host_or_nick, NULL)) == NULL) return 0; if (IsExemptKline(target_p)) { if (!IsServer(source_p)) sendto_one(source_p, ":%s NOTICE %s :%s is E-lined", me.name, source_p->name, target_p->name); return 0; } /* * turn the "user" bit into "*user", blow away '~' * if found in original user name (non-idented) */ strlcpy(luser, target_p->username, USERLEN*4 + 1); if (target_p->username[0] == '~') luser[0] = '*'; if (target_p->sockhost[0] == '\0' || (target_p->sockhost[0] == '0' && target_p->sockhost[1] == '\0')) strlcpy(lhost, target_p->host, HOSTLEN*4 + 1); else strlcpy(lhost, target_p->sockhost, HOSTLEN*4 + 1); return 1; } return 0; } /* valid_comment() * * inputs - pointer to client * - pointer to comment * output - 0 if no valid comment, * - 1 if valid * side effects - truncates reason where necessary */ int valid_comment(struct Client *source_p, char *comment, int warn) { if (strlen(comment) > REASONLEN) comment[REASONLEN-1] = '\0'; return 1; } /* match_conf_password() * * inputs - pointer to given password * - pointer to Conf * output - 1 or 0 if match * side effects - none */ int match_conf_password(const char *password, const struct MaskItem *conf) { const char *encr = NULL; if (EmptyString(password) || EmptyString(conf->passwd)) return 0; if (conf->flags & CONF_FLAGS_ENCRYPTED) encr = crypt(password, conf->passwd); else encr = password; return !strcmp(encr, conf->passwd); } /* * cluster_a_line * * inputs - client sending the cluster * - command name "KLINE" "XLINE" etc. * - capab -- CAP_KLN etc. from s_serv.h * - cluster type -- CLUSTER_KLINE etc. from conf.h * - pattern and args to send along * output - none * side effects - Take source_p send the pattern with args given * along to all servers that match capab and cluster type */ void cluster_a_line(struct Client *source_p, const char *command, int capab, int cluster_type, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; const dlink_node *ptr = NULL; va_start(args, pattern); vsnprintf(buffer, sizeof(buffer), pattern, args); va_end(args); DLINK_FOREACH(ptr, cluster_items.head) { const struct MaskItem *conf = ptr->data; if (conf->flags & cluster_type) sendto_match_servs(source_p, conf->name, CAP_CLUSTER|capab, "%s %s %s", command, conf->name, buffer); } } /* * split_nuh * * inputs - pointer to original mask (modified in place) * - pointer to pointer where nick should go * - pointer to pointer where user should go * - pointer to pointer where host should go * output - NONE * side effects - mask is modified in place * If nick pointer is NULL, ignore writing to it * this allows us to use this function elsewhere. * * mask nick user host * ---------------------- ------- ------- ------ * Dianora!db@db.net Dianora db db.net * Dianora Dianora * * * db.net * * db.net * OR if nick pointer is NULL * Dianora - * Dianora * Dianora! Dianora * * * Dianora!@ Dianora * * * Dianora!db Dianora db * * Dianora!@db.net Dianora * db.net * db@db.net * db db.net * !@ * * * * @ * * * * ! * * * */ void split_nuh(struct split_nuh_item *const iptr) { char *p = NULL, *q = NULL; if (iptr->nickptr) strlcpy(iptr->nickptr, "*", iptr->nicksize); if (iptr->userptr) strlcpy(iptr->userptr, "*", iptr->usersize); if (iptr->hostptr) strlcpy(iptr->hostptr, "*", iptr->hostsize); if ((p = strchr(iptr->nuhmask, '!'))) { *p = '\0'; if (iptr->nickptr && *iptr->nuhmask != '\0') strlcpy(iptr->nickptr, iptr->nuhmask, iptr->nicksize); if ((q = strchr(++p, '@'))) { *q++ = '\0'; if (*p != '\0') strlcpy(iptr->userptr, p, iptr->usersize); if (*q != '\0') strlcpy(iptr->hostptr, q, iptr->hostsize); } else { if (*p != '\0') strlcpy(iptr->userptr, p, iptr->usersize); } } else { /* No ! found so lets look for a user@host */ if ((p = strchr(iptr->nuhmask, '@'))) { /* if found a @ */ *p++ = '\0'; if (*iptr->nuhmask != '\0') strlcpy(iptr->userptr, iptr->nuhmask, iptr->usersize); if (*p != '\0') strlcpy(iptr->hostptr, p, iptr->hostsize); } else { /* no @ found */ if (!iptr->nickptr || strpbrk(iptr->nuhmask, ".:")) strlcpy(iptr->hostptr, iptr->nuhmask, iptr->hostsize); else strlcpy(iptr->nickptr, iptr->nuhmask, iptr->nicksize); } } } ircd-hybrid-8.1.13.dfsg.1/src/ircd_signal.c0000644000175000017500000000575512263053413016431 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd_signal.c: responsible for ircd's signal handling * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd_signal.c 1309 2012-03-25 11:24:18Z michael $ */ #include "stdinc.h" #include "list.h" #include "ircd_signal.h" #include "ircd.h" /* dorehash */ #include "restart.h" /* server_die */ #include "memory.h" #include "s_bsd.h" /* * sigterm_handler - exit the server */ static void sigterm_handler(int sig) { server_die("received signal SIGTERM", 0); } /* * sighup_handler - reread the server configuration */ static void sighup_handler(int sig) { dorehash = 1; } /* * sigusr1_handler - reread the motd file */ static void sigusr1_handler(int sig) { doremotd = 1; } /* * * inputs - nothing * output - nothing * side effects - Reaps zombies periodically * -AndroSyn */ static void sigchld_handler(int sig) { int status; waitpid(-1, &status, WNOHANG); } /* * sigint_handler - restart the server */ static void sigint_handler(int sig) { server_die("SIGINT received", !server_state.foreground); } /* * setup_signals - initialize signal handlers for server */ void setup_signals(void) { struct sigaction act; act.sa_flags = 0; act.sa_handler = SIG_IGN; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGPIPE); sigaddset(&act.sa_mask, SIGALRM); sigaction(SIGALRM, &act, 0); #ifdef SIGTRAP sigaddset(&act.sa_mask, SIGTRAP); #endif #ifdef SIGXFSZ sigaddset(&act.sa_mask, SIGXFSZ); sigaction(SIGXFSZ, &act, 0); #endif #ifdef SIGWINCH sigaddset(&act.sa_mask, SIGWINCH); sigaction(SIGWINCH, &act, 0); #endif sigaction(SIGPIPE, &act, 0); #ifdef SIGTRAP sigaction(SIGTRAP, &act, 0); #endif act.sa_handler = sighup_handler; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGHUP); sigaction(SIGHUP, &act, 0); act.sa_handler = sigint_handler; sigaddset(&act.sa_mask, SIGINT); sigaction(SIGINT, &act, 0); act.sa_handler = sigterm_handler; sigaddset(&act.sa_mask, SIGTERM); sigaction(SIGTERM, &act, 0); act.sa_handler = sigusr1_handler; sigaddset(&act.sa_mask, SIGUSR1); sigaction(SIGUSR1, &act, 0); act.sa_handler = sigchld_handler; sigaddset(&act.sa_mask, SIGCHLD); sigaction(SIGCHLD, &act, 0); } ircd-hybrid-8.1.13.dfsg.1/src/hostmask.c0000644000175000017500000005141212263053413015773 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * hostmask.c: Code to efficiently find IP & hostmask based configs. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hostmask.c 2332 2013-06-23 13:52:31Z michael $ */ #include "stdinc.h" #include "memory.h" #include "ircd_defs.h" #include "list.h" #include "conf.h" #include "hostmask.h" #include "send.h" #include "irc_string.h" #include "ircd.h" #define DigitParse(ch) do { \ if (ch >= '0' && ch <= '9') \ ch = ch - '0'; \ else if (ch >= 'A' && ch <= 'F') \ ch = ch - 'A' + 10; \ else if (ch >= 'a' && ch <= 'f') \ ch = ch - 'a' + 10; \ } while (0); /* The mask parser/type determination code... */ /* int try_parse_v6_netmask(const char *, struct irc_ssaddr *, int *); * Input: A possible IPV6 address as a string. * Output: An integer describing whether it is an IPV6 or hostmask, * an address(if it is IPV6), a bitlength(if it is IPV6). * Side effects: None * Comments: Called from parse_netmask */ /* Fixed so ::/0 (any IPv6 address) is valid Also a bug in DigitParse above. -Gozem 2002-07-19 gozem@linux.nu */ #ifdef IPV6 static int try_parse_v6_netmask(const char *text, struct irc_ssaddr *addr, int *b) { const char *p; char c; int d[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; int dp = 0; int nyble = 4; int finsert = -1; int bits = 128; int deficit = 0; short dc[8]; struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr; for (p = text; (c = *p); p++) if (IsXDigit(c)) { if (nyble == 0) return HM_HOST; DigitParse(c); d[dp] |= c << (4 * --nyble); } else if (c == ':') { if (p > text && *(p - 1) == ':') { if (finsert >= 0) return HM_HOST; finsert = dp; } else { /* If there were less than 4 hex digits, e.g. :ABC: shift right * so we don't interpret it as ABC0 -A1kmm */ d[dp] = d[dp] >> 4 * nyble; nyble = 4; if (++dp >= 8) return HM_HOST; } } else if (c == '*') { /* * must be last, and * is ambiguous if there is a ::... -A1kmm */ if (finsert >= 0 || *(p + 1) || dp == 0 || *(p - 1) != ':') return HM_HOST; bits = dp * 16; } else if (c == '/') { char *after; d[dp] = d[dp] >> 4 * nyble; dp++; bits = strtoul(p + 1, &after, 10); if (bits < 0 || *after) return HM_HOST; if (bits > dp * 4 && !(finsert >= 0 && bits <= 128)) return HM_HOST; break; } else return HM_HOST; d[dp] = d[dp] >> 4 * nyble; if (c == 0) dp++; if (finsert < 0 && bits == 0) bits = dp * 16; /* How many words are missing? -A1kmm */ deficit = bits / 16 + ((bits % 16) ? 1 : 0) - dp; /* Now fill in the gaps(from ::) in the copied table... -A1kmm */ for (dp = 0, nyble = 0; dp < 8; dp++) { if (nyble == finsert && deficit) { dc[dp] = 0; deficit--; } else dc[dp] = d[nyble++]; } /* Set unused bits to 0... -A1kmm */ if (bits < 128 && (bits % 16 != 0)) dc[bits / 16] &= ~((1 << (15 - bits % 16)) - 1); for (dp = bits / 16 + (bits % 16 ? 1 : 0); dp < 8; dp++) dc[dp] = 0; /* And assign... -A1kmm */ if (addr) for (dp = 0; dp < 8; dp++) /* The cast is a kludge to make netbsd work. */ ((unsigned short *)&v6->sin6_addr)[dp] = htons(dc[dp]); if (b != NULL) *b = bits; return HM_IPV6; } #endif /* int try_parse_v4_netmask(const char *, struct irc_ssaddr *, int *); * Input: A possible IPV4 address as a string. * Output: An integer describing whether it is an IPV4 or hostmask, * an address(if it is IPV4), a bitlength(if it is IPV4). * Side effects: None * Comments: Called from parse_netmask */ static int try_parse_v4_netmask(const char *text, struct irc_ssaddr *addr, int *b) { const char *p; const char *digits[4]; unsigned char addb[4]; int n = 0, bits = 0; char c; struct sockaddr_in *v4 = (struct sockaddr_in *)addr; digits[n++] = text; for (p = text; (c = *p); p++) if (c >= '0' && c <= '9') /* empty */ ; else if (c == '.') { if (n >= 4) return HM_HOST; digits[n++] = p + 1; } else if (c == '*') { if (*(p + 1) || n == 0 || *(p - 1) != '.') return HM_HOST; bits = (n - 1) * 8; break; } else if (c == '/') { char *after; bits = strtoul(p + 1, &after, 10); if (bits < 0 || *after) return HM_HOST; if (bits > n * 8) return HM_HOST; break; } else return HM_HOST; if (n < 4 && bits == 0) bits = n * 8; if (bits) while (n < 4) digits[n++] = "0"; for (n = 0; n < 4; n++) addb[n] = strtoul(digits[n], NULL, 10); if (bits == 0) bits = 32; /* Set unused bits to 0... -A1kmm */ if (bits < 32 && bits % 8) addb[bits / 8] &= ~((1 << (8 - bits % 8)) - 1); for (n = bits / 8 + (bits % 8 ? 1 : 0); n < 4; n++) addb[n] = 0; if (addr) v4->sin_addr.s_addr = htonl(addb[0] << 24 | addb[1] << 16 | addb[2] << 8 | addb[3]); if (b != NULL) *b = bits; return HM_IPV4; } /* int parse_netmask(const char *, struct irc_ssaddr *, int *); * Input: A hostmask, or an IPV4/6 address. * Output: An integer describing whether it is an IPV4, IPV6 address or a * hostmask, an address(if it is an IP mask), * a bitlength(if it is IP mask). * Side effects: None */ int parse_netmask(const char *text, struct irc_ssaddr *addr, int *b) { #ifdef IPV6 if (strchr(text, ':')) return try_parse_v6_netmask(text, addr, b); #endif if (strchr(text, '.')) return try_parse_v4_netmask(text, addr, b); return HM_HOST; } /* The address matching stuff... */ /* int match_ipv6(struct irc_ssaddr *, struct irc_ssaddr *, int) * Input: An IP address, an IP mask, the number of bits in the mask. * Output: if match, -1 else 0 * Side effects: None */ #ifdef IPV6 int match_ipv6(const struct irc_ssaddr *addr, const struct irc_ssaddr *mask, int bits) { int i, m, n = bits / 8; const struct sockaddr_in6 *v6 = (const struct sockaddr_in6 *)addr; const struct sockaddr_in6 *v6mask = (const struct sockaddr_in6 *)mask; for (i = 0; i < n; i++) if (v6->sin6_addr.s6_addr[i] != v6mask->sin6_addr.s6_addr[i]) return 0; if ((m = bits % 8) == 0) return -1; if ((v6->sin6_addr.s6_addr[n] & ~((1 << (8 - m)) - 1)) == v6mask->sin6_addr.s6_addr[n]) return -1; return 0; } #endif /* int match_ipv4(struct irc_ssaddr *, struct irc_ssaddr *, int) * Input: An IP address, an IP mask, the number of bits in the mask. * Output: if match, -1 else 0 * Side Effects: None */ int match_ipv4(const struct irc_ssaddr *addr, const struct irc_ssaddr *mask, int bits) { const struct sockaddr_in *v4 = (const struct sockaddr_in *)addr; const struct sockaddr_in *v4mask = (const struct sockaddr_in *)mask; if ((ntohl(v4->sin_addr.s_addr) & ~((1 << (32 - bits)) - 1)) != ntohl(v4mask->sin_addr.s_addr)) return 0; return -1; } /* * mask_addr * * inputs - pointer to the ip to mask * - bitlen * output - NONE * side effects - */ void mask_addr(struct irc_ssaddr *ip, int bits) { int mask; #ifdef IPV6 struct sockaddr_in6 *v6_base_ip; int i, m, n; #endif struct sockaddr_in *v4_base_ip; #ifdef IPV6 if (ip->ss.ss_family != AF_INET6) #endif { v4_base_ip = (struct sockaddr_in *)ip; mask = ~((1 << (32 - bits)) - 1); v4_base_ip->sin_addr.s_addr = htonl(ntohl(v4_base_ip->sin_addr.s_addr) & mask); } #ifdef IPV6 else { n = bits / 8; m = bits % 8; v6_base_ip = (struct sockaddr_in6 *)ip; mask = ~((1 << (8 - m)) -1 ); v6_base_ip->sin6_addr.s6_addr[n] = v6_base_ip->sin6_addr.s6_addr[n] & mask; for (i = n + 1; i < 16; i++) v6_base_ip->sin6_addr.s6_addr[i] = 0; } #endif } /* Hashtable stuff...now external as its used in m_stats.c */ dlink_list atable[ATABLE_SIZE]; void init_host_hash(void) { memset(&atable, 0, sizeof(atable)); } /* unsigned long hash_ipv4(struct irc_ssaddr*) * Input: An IP address. * Output: A hash value of the IP address. * Side effects: None */ static uint32_t hash_ipv4(struct irc_ssaddr *addr, int bits) { if (bits != 0) { struct sockaddr_in *v4 = (struct sockaddr_in *)addr; uint32_t av = ntohl(v4->sin_addr.s_addr) & ~((1 << (32 - bits)) - 1); return (av ^ (av >> 12) ^ (av >> 24)) & (ATABLE_SIZE - 1); } return 0; } /* unsigned long hash_ipv6(struct irc_ssaddr*) * Input: An IP address. * Output: A hash value of the IP address. * Side effects: None */ #ifdef IPV6 static uint32_t hash_ipv6(struct irc_ssaddr *addr, int bits) { uint32_t v = 0, n; struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr; for (n = 0; n < 16; n++) { if (bits >= 8) { v ^= v6->sin6_addr.s6_addr[n]; bits -= 8; } else if (bits) { v ^= v6->sin6_addr.s6_addr[n] & ~((1 << (8 - bits)) - 1); return v & (ATABLE_SIZE - 1); } else return v & (ATABLE_SIZE - 1); } return v & (ATABLE_SIZE - 1); } #endif /* int hash_text(const char *start) * Input: The start of the text to hash. * Output: The hash of the string between 1 and (TH_MAX-1) * Side-effects: None. */ static uint32_t hash_text(const char *start) { const char *p = start; uint32_t h = 0; for (; *p; ++p) h = (h << 4) - (h + ToLower(*p)); return h & (ATABLE_SIZE - 1); } /* unsigned long get_hash_mask(const char *) * Input: The text to hash. * Output: The hash of the string right of the first '.' past the last * wildcard in the string. * Side-effects: None. */ static uint32_t get_mask_hash(const char *text) { const char *hp = "", *p; for (p = text + strlen(text) - 1; p >= text; p--) if (IsMWildChar(*p)) return hash_text(hp); else if (*p == '.') hp = p + 1; return hash_text(text); } /* struct MaskItem *find_conf_by_address(const char *, struct irc_ssaddr *, * int type, int fam, const char *username) * Input: The hostname, the address, the type of mask to find, the address * family, the username. * Output: The matching value with the highest precedence. * Side-effects: None * Note: Setting bit 0 of the type means that the username is ignored. * Warning: IsNeedPassword for everything that is not an auth{} entry * should always be true (i.e. conf->flags & CONF_FLAGS_NEED_PASSWORD == 0) */ struct MaskItem * find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int type, int fam, const char *username, const char *password, int do_match) { unsigned int hprecv = 0; dlink_node *ptr = NULL; struct MaskItem *hprec = NULL; struct AddressRec *arec = NULL; int b; int (*cmpfunc)(const char *, const char *) = do_match ? match : irccmp; if (username == NULL) username = ""; if (password == NULL) password = ""; if (addr) { /* Check for IPV6 matches... */ #ifdef IPV6 if (fam == AF_INET6) { for (b = 128; b >= 0; b -= 16) { DLINK_FOREACH(ptr, atable[hash_ipv6(addr, b)].head) { arec = ptr->data; if (arec->type == (type & ~0x1) && arec->precedence > hprecv && arec->masktype == HM_IPV6 && match_ipv6(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && (type & 0x1 || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; } } } } else #endif if (fam == AF_INET) { for (b = 32; b >= 0; b -= 8) { DLINK_FOREACH(ptr, atable[hash_ipv4(addr, b)].head) { arec = ptr->data; if (arec->type == (type & ~0x1) && arec->precedence > hprecv && arec->masktype == HM_IPV4 && match_ipv4(addr, &arec->Mask.ipa.addr, arec->Mask.ipa.bits) && (type & 0x1 || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; } } } } } if (name != NULL) { const char *p = name; while (1) { DLINK_FOREACH(ptr, atable[hash_text(p)].head) { arec = ptr->data; if ((arec->type == (type & ~0x1)) && arec->precedence > hprecv && (arec->masktype == HM_HOST) && !cmpfunc(arec->Mask.hostname, name) && (type & 0x1 || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; } } p = strchr(p, '.'); if (p == NULL) break; p++; } DLINK_FOREACH(ptr, atable[0].head) { arec = ptr->data; if (arec->type == (type & ~0x1) && arec->precedence > hprecv && arec->masktype == HM_HOST && !cmpfunc(arec->Mask.hostname, name) && (type & 0x1 || !cmpfunc(arec->username, username)) && (IsNeedPassword(arec->conf) || arec->conf->passwd == NULL || match_conf_password(password, arec->conf))) { hprecv = arec->precedence; hprec = arec->conf; } } } return hprec; } /* struct MaskItem* find_address_conf(const char*, const char*, * struct irc_ssaddr*, int, char *); * Input: The hostname, username, address, address family. * Output: The applicable MaskItem. * Side-effects: None */ struct MaskItem * find_address_conf(const char *host, const char *user, struct irc_ssaddr *ip, int aftype, char *password) { struct MaskItem *authcnf = NULL, *killcnf = NULL; /* Find the best auth{} block... If none, return NULL -A1kmm */ if ((authcnf = find_conf_by_address(host, ip, CONF_CLIENT, aftype, user, password, 1)) == NULL) return NULL; /* If they are exempt from K-lines, return the best auth{} block. -A1kmm */ if (IsConfExemptKline(authcnf)) return authcnf; /* Find the best K-line... -A1kmm */ killcnf = find_conf_by_address(host, ip, CONF_KLINE, aftype, user, NULL, 1); /* * If they are K-lined, return the K-line. Otherwise, return the * auth{} block. -A1kmm */ if (killcnf != NULL) return killcnf; if (IsConfExemptGline(authcnf)) return authcnf; killcnf = find_conf_by_address(host, ip, CONF_GLINE, aftype, user, NULL, 1); if (killcnf != NULL) return killcnf; return authcnf; } /* struct MaskItem* find_dline_conf(struct irc_ssaddr*, int) * * Input: An address, an address family. * Output: The best matching D-line or exempt line. * Side effects: None. */ struct MaskItem * find_dline_conf(struct irc_ssaddr *addr, int aftype) { struct MaskItem *eline; eline = find_conf_by_address(NULL, addr, CONF_EXEMPT | 1, aftype, NULL, NULL, 1); if (eline != NULL) return eline; return find_conf_by_address(NULL, addr, CONF_DLINE | 1, aftype, NULL, NULL, 1); } /* void add_conf_by_address(int, struct MaskItem *aconf) * Input: * Output: None * Side-effects: Adds this entry to the hash table. */ void add_conf_by_address(const unsigned int type, struct MaskItem *conf) { const char *address; const char *username; static unsigned int prec_value = 0xFFFFFFFF; int bits = 0; struct AddressRec *arec; address = conf->host; username = conf->user; assert(type); if (EmptyString(address)) address = "/NOMATCH!/"; arec = MyMalloc(sizeof(struct AddressRec)); arec->masktype = parse_netmask(address, &arec->Mask.ipa.addr, &bits); arec->Mask.ipa.bits = bits; arec->username = username; arec->conf = conf; arec->precedence = prec_value--; arec->type = type; switch (arec->masktype) { case HM_IPV4: /* We have to do this, since we do not re-hash for every bit -A1kmm. */ bits -= bits % 8; dlinkAdd(arec, &arec->node, &atable[hash_ipv4(&arec->Mask.ipa.addr, bits)]); break; #ifdef IPV6 case HM_IPV6: /* We have to do this, since we do not re-hash for every bit -A1kmm. */ bits -= bits % 16; dlinkAdd(arec, &arec->node, &atable[hash_ipv6(&arec->Mask.ipa.addr, bits)]); break; #endif default: /* HM_HOST */ arec->Mask.hostname = address; dlinkAdd(arec, &arec->node, &atable[get_mask_hash(address)]); break; } } /* void delete_one_address(const char*, struct MaskItem*) * Input: An address string, the associated MaskItem. * Output: None * Side effects: Deletes an address record. Frees the MaskItem if there * is nothing referencing it, sets it as illegal otherwise. */ void delete_one_address_conf(const char *address, struct MaskItem *conf) { int bits = 0; uint32_t hv = 0; dlink_node *ptr = NULL, *ptr_next = NULL; struct irc_ssaddr addr; switch (parse_netmask(address, &addr, &bits)) { case HM_IPV4: /* We have to do this, since we do not re-hash for every bit -A1kmm. */ bits -= bits % 8; hv = hash_ipv4(&addr, bits); break; #ifdef IPV6 case HM_IPV6: /* We have to do this, since we do not re-hash for every bit -A1kmm. */ bits -= bits % 16; hv = hash_ipv6(&addr, bits); break; #endif default: /* HM_HOST */ hv = get_mask_hash(address); break; } DLINK_FOREACH_SAFE(ptr, ptr_next, atable[hv].head) { struct AddressRec *arec = ptr->data; if (arec->conf == conf) { dlinkDelete(&arec->node, &atable[hv]); if (!conf->ref_count) conf_free(conf); MyFree(arec); return; } } } /* void clear_out_address_conf(void) * Input: None * Output: None * Side effects: Clears out all address records in the hash table, * frees them, and frees the MaskItems if nothing references * them, otherwise sets them as illegal. */ void clear_out_address_conf(void) { unsigned int i = 0; dlink_node *ptr = NULL, *ptr_next = NULL; for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH_SAFE(ptr, ptr_next, atable[i].head) { struct AddressRec *arec = ptr->data; /* * We keep the temporary K-lines and destroy the permanent ones, * just to be confusing :) -A1kmm */ if (arec->conf->until || IsConfDatabase(arec->conf)) continue; dlinkDelete(&arec->node, &atable[i]); if (!arec->conf->ref_count) conf_free(arec->conf); MyFree(arec); } } } static void hostmask_send_expiration(struct AddressRec *arec) { char ban_type = '\0'; if (!ConfigFileEntry.tkline_expire_notices) return; switch (arec->type) { case CONF_KLINE: ban_type = 'K'; break; case CONF_DLINE: ban_type = 'D'; break; case CONF_GLINE: ban_type = 'G'; break; default: break; } sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Temporary %c-line for [%s@%s] expired", ban_type, (arec->conf->user) ? arec->conf->user : "*", (arec->conf->host) ? arec->conf->host : "*"); } void hostmask_expire_temporary(void) { unsigned int i = 0; dlink_node *ptr = NULL, *ptr_next = NULL; for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH_SAFE(ptr, ptr_next, atable[i].head) { struct AddressRec *arec = ptr->data; if (!arec->conf->until || arec->conf->until > CurrentTime) continue; switch (arec->type) { case CONF_KLINE: case CONF_DLINE: case CONF_GLINE: hostmask_send_expiration(arec); dlinkDelete(&arec->node, &atable[i]); conf_free(arec->conf); MyFree(arec); break; default: break; } } } } ircd-hybrid-8.1.13.dfsg.1/src/conf_lexer.l0000644000175000017500000004524212263053413016303 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * conf_lexer.l: Scans the ircd configuration file for tokens. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: conf_lexer.l 2284 2013-06-18 19:16:46Z michael $ */ %option case-insensitive %option noyywrap %option nounput %option never-interactive %{ #include "stdinc.h" #include "irc_string.h" #include "conf.h" #include "conf_parser.h" /* autogenerated header file */ #include "log.h" #undef YY_INPUT #define YY_FATAL_ERROR(msg) conf_yy_fatal_error(msg) #define YY_INPUT(buf,result,max_size) \ if (!(result = conf_yy_input(buf, max_size))) \ YY_FATAL_ERROR("input in flex scanner failed"); #define MAX_INCLUDE_DEPTH 10 unsigned int lineno = 1; char linebuf[IRCD_BUFSIZE]; char conffilebuf[IRCD_BUFSIZE]; static int include_stack_ptr = 0; static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static unsigned int lineno_stack[MAX_INCLUDE_DEPTH]; static FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH]; static char conffile_stack[MAX_INCLUDE_DEPTH][IRCD_BUFSIZE]; static void ccomment(void); static void cinclude(void); static int ieof(void); static int conf_yy_input(char *lbuf, unsigned int max_size) { return !fgets(lbuf, max_size, conf_parser_ctx.conf_file) ? 0 : strlen(lbuf); } static int conf_yy_fatal_error(const char *msg) { return 0; } %} WS [[:blank:]]* DIGIT [[:digit:]]+ COMMENT ("//"|"#").* qstring \"[^\"\n]*[\"\n] include \.include{WS}(\<.*\>|\".*\") %% {include} { cinclude(); } "/*" { ccomment(); } \n.* { strlcpy(linebuf, yytext+1, sizeof(linebuf)); ++lineno; yyless(1); } {WS} ; {COMMENT} ; {DIGIT} { yylval.number = atoi(yytext); return NUMBER; } {qstring} { if (yytext[yyleng-2] == '\\') { yyless(yyleng-1); /* return last quote */ yymore(); /* append next string */ } else { yylval.string = yytext+1; if(yylval.string[yyleng-2] != '"') ilog(LOG_TYPE_IRCD, "Unterminated character string"); else { int i,j; yylval.string[yyleng-2] = '\0'; /* remove close * quote */ for (j=i=0 ;yylval.string[i] != '\0'; i++,j++) { if (yylval.string[i] != '\\') { yylval.string[j] = yylval.string[i]; } else { i++; if (yylval.string[i] == '\0') /* XXX * should not * happen */ { ilog(LOG_TYPE_IRCD, "Unterminated character string"); break; } yylval.string[j] = yylval.string[i]; } } yylval.string[j] = '\0'; return QSTRING; } } } accept_password { return ACCEPT_PASSWORD; } admin { return ADMIN; } administrator { return ADMIN; } aftype { return AFTYPE; } all { return T_ALL; } anti_nick_flood { return ANTI_NICK_FLOOD; } anti_spam_exit_message_time { return ANTI_SPAM_EXIT_MESSAGE_TIME; } auth { return IRCD_AUTH; } autoconn { return AUTOCONN; } bots { return T_BOTS; } caller_id_wait { return CALLER_ID_WAIT; } callerid { return T_CALLERID; } can_flood { return CAN_FLOOD; } cconn { return T_CCONN; } channel { return CHANNEL; } cidr_bitlen_ipv4 { return CIDR_BITLEN_IPV4; } cidr_bitlen_ipv6 { return CIDR_BITLEN_IPV6; } class { return CLASS; } cluster { return T_CLUSTER; } connect { return CONNECT; } connectfreq { return CONNECTFREQ; } cycle_on_host_change { return CYCLE_ON_HOST_CHANGE; } deaf { return T_DEAF; } debug { return T_DEBUG; } default_floodcount { return DEFAULT_FLOODCOUNT; } default_split_server_count { return DEFAULT_SPLIT_SERVER_COUNT; } default_split_user_count { return DEFAULT_SPLIT_USER_COUNT; } deny { return DENY; } description { return DESCRIPTION; } die { return DIE; } disable_auth { return DISABLE_AUTH; } disable_fake_channels { return DISABLE_FAKE_CHANNELS; } disable_remote_commands { return DISABLE_REMOTE_COMMANDS; } dline { return T_DLINE; } dots_in_ident { return DOTS_IN_IDENT; } egdpool_path { return EGDPOOL_PATH; } email { return EMAIL; } encrypted { return ENCRYPTED; } exceed_limit { return EXCEED_LIMIT; } exempt { return EXEMPT; } external { return T_EXTERNAL; } failed_oper_notice { return FAILED_OPER_NOTICE; } farconnect { return T_FARCONNECT; } file { return T_FILE; } flags { return IRCD_FLAGS; } flatten_links { return FLATTEN_LINKS; } full { return T_FULL; } gecos { return GECOS; } general { return GENERAL; } gline { return GLINE; } gline_duration { return GLINE_DURATION; } gline_enable { return GLINE_ENABLE; } gline_exempt { return GLINE_EXEMPT; } gline_min_cidr { return GLINE_MIN_CIDR; } gline_min_cidr6 { return GLINE_MIN_CIDR6; } gline_request_duration { return GLINE_REQUEST_DURATION; } global_kill { return GLOBAL_KILL; } globops { return T_GLOBOPS; } have_ident { return NEED_IDENT; } havent_read_conf { return HAVENT_READ_CONF; } hidden { return HIDDEN; } hidden_name { return HIDDEN_NAME; } hide_idle_from_opers { return HIDE_IDLE_FROM_OPERS; } hide_server_ips { return HIDE_SERVER_IPS; } hide_servers { return HIDE_SERVERS; } hide_services { return HIDE_SERVICES; } hide_spoof_ips { return HIDE_SPOOF_IPS; } host { return HOST; } hub { return HUB; } hub_mask { return HUB_MASK; } ignore_bogus_ts { return IGNORE_BOGUS_TS; } invisible { return T_INVISIBLE; } invisible_on_connect { return INVISIBLE_ON_CONNECT; } ip { return IP; } ipv4 { return T_IPV4; } ipv6 { return T_IPV6; } join_flood_count { return JOIN_FLOOD_COUNT; } join_flood_time { return JOIN_FLOOD_TIME; } kill { return KILL; } kill_chase_time_limit { return KILL_CHASE_TIME_LIMIT; } kline { return KLINE; } kline_exempt { return KLINE_EXEMPT; } knock_delay { return KNOCK_DELAY; } knock_delay_channel { return KNOCK_DELAY_CHANNEL; } leaf_mask { return LEAF_MASK; } links_delay { return LINKS_DELAY; } listen { return LISTEN; } locops { return T_LOCOPS; } log { return T_LOG; } mask { return MASK; } masked { return TMASKED; } max_accept { return MAX_ACCEPT; } max_bans { return MAX_BANS; } max_chans_per_oper { return MAX_CHANS_PER_OPER; } max_chans_per_user { return MAX_CHANS_PER_USER; } max_clients { return T_MAX_CLIENTS; } max_global { return MAX_GLOBAL; } max_ident { return MAX_IDENT; } max_idle { return MAX_IDLE; } max_local { return MAX_LOCAL; } max_nick_changes { return MAX_NICK_CHANGES; } max_nick_length { return MAX_NICK_LENGTH; } max_nick_time { return MAX_NICK_TIME; } max_number { return MAX_NUMBER; } max_targets { return MAX_TARGETS; } max_topic_length { return MAX_TOPIC_LENGTH; } max_watch { return MAX_WATCH; } min_idle { return MIN_IDLE; } min_nonwildcard { return MIN_NONWILDCARD; } min_nonwildcard_simple { return MIN_NONWILDCARD_SIMPLE; } module { return MODULE; } modules { return MODULES; } motd { return MOTD; } name { return NAME; } nchange { return T_NCHANGE; } need_ident { return NEED_IDENT; } need_password { return NEED_PASSWORD; } network_desc { return NETWORK_DESC; } network_name { return NETWORK_NAME; } nick { return NICK; } no_create_on_split { return NO_CREATE_ON_SPLIT; } no_join_on_split { return NO_JOIN_ON_SPLIT; } no_oper_flood { return NO_OPER_FLOOD; } no_tilde { return NO_TILDE; } nononreg { return T_NONONREG; } number_per_cidr { return NUMBER_PER_CIDR; } number_per_ip { return NUMBER_PER_IP; } oper { return OPERATOR; } oper_only_umodes { return OPER_ONLY_UMODES; } oper_pass_resv { return OPER_PASS_RESV; } oper_umodes { return OPER_UMODES; } operator { return OPERATOR; } opers_bypass_callerid { return OPERS_BYPASS_CALLERID; } operwall { return T_OPERWALL; } pace_wait { return PACE_WAIT; } pace_wait_simple { return PACE_WAIT_SIMPLE; } passwd { return PASSWORD; } password { return PASSWORD; } path { return PATH; } ping_cookie { return PING_COOKIE; } ping_time { return PING_TIME; } port { return PORT; } quarantine { return RESV; } random_idle { return RANDOM_IDLE; } reason { return REASON; } recvq { return T_RECVQ; } redirport { return REDIRPORT; } redirserv { return REDIRSERV; } rehash { return REHASH; } rej { return T_REJ; } remote { return REMOTE; } remoteban { return REMOTEBAN; } restart { return T_RESTART; } resv { return RESV; } resv_exempt { return RESV_EXEMPT; } rsa_private_key_file { return RSA_PRIVATE_KEY_FILE; } rsa_public_key_file { return RSA_PUBLIC_KEY_FILE; } send_password { return SEND_PASSWORD; } sendq { return SENDQ; } server { return T_SERVER; } serverhide { return SERVERHIDE; } serverinfo { return SERVERINFO; } service { return T_SERVICE; } services_name { return T_SERVICES_NAME; } servnotice { return T_SERVNOTICE; } set { return T_SET; } shared { return T_SHARED; } short_motd { return SHORT_MOTD; } sid { return IRCD_SID; } size { return T_SIZE; } skill { return T_SKILL; } softcallerid { return T_SOFTCALLERID; } spoof { return SPOOF; } spoof_notice { return SPOOF_NOTICE; } spy { return T_SPY; } squit { return SQUIT; } ssl { return T_SSL; } ssl_certificate_file { return SSL_CERTIFICATE_FILE; } ssl_certificate_fingerprint { return SSL_CERTIFICATE_FINGERPRINT; } ssl_cipher_list { return T_SSL_CIPHER_LIST; } ssl_client_method { return T_SSL_CLIENT_METHOD; } ssl_connection_required { return SSL_CONNECTION_REQUIRED; } ssl_dh_param_file { return SSL_DH_PARAM_FILE; } ssl_server_method { return T_SSL_SERVER_METHOD; } sslv3 { return T_SSLV3; } stats_e_disabled { return STATS_E_DISABLED; } stats_i_oper_only { return STATS_I_OPER_ONLY; } stats_k_oper_only { return STATS_K_OPER_ONLY; } stats_o_oper_only { return STATS_O_OPER_ONLY; } stats_P_oper_only { return STATS_P_OPER_ONLY; } stats_u_oper_only { return STATS_U_OPER_ONLY; } throttle_time { return THROTTLE_TIME; } tkline_expire_notices { return TKLINE_EXPIRE_NOTICES; } tlsv1 { return T_TLSV1; } true_no_oper_flood { return TRUE_NO_OPER_FLOOD; } ts_max_delta { return TS_MAX_DELTA; } ts_warn_delta { return TS_WARN_DELTA; } type { return TYPE; } umodes { return T_UMODES; } unauth { return T_UNAUTH; } undline { return T_UNDLINE; } unkline { return UNKLINE; } unlimited { return T_UNLIMITED; } unresv { return T_UNRESV; } unxline { return T_UNXLINE; } use_egd { return USE_EGD; } use_logging { return USE_LOGGING; } user { return USER; } vhost { return VHOST; } vhost6 { return VHOST6; } wallop { return T_WALLOP; } wallops { return T_WALLOPS; } warn_no_nline { return WARN_NO_NLINE; } webirc { return T_WEBIRC; } xline { return XLINE; } yes { yylval.number = 1; return TBOOL; } no { yylval.number = 0; return TBOOL; } years { return YEARS; } year { return YEARS; } months { return MONTHS; } month { return MONTHS; } weeks { return WEEKS; } week { return WEEKS; } days { return DAYS; } day { return DAYS; } hours { return HOURS; } hour { return HOURS; } minutes { return MINUTES; } minute { return MINUTES; } seconds { return SECONDS; } second { return SECONDS; } bytes { return BYTES; } byte { return BYTES; } kilobytes { return KBYTES; } kilobyte { return KBYTES; } kbytes { return KBYTES; } kbyte { return KBYTES; } kb { return KBYTES; } megabytes { return MBYTES; } megabyte { return MBYTES; } mbytes { return MBYTES; } mbyte { return MBYTES; } mb { return MBYTES; } \.\. { return TWODOTS; } . { return yytext[0]; } <> { if (ieof()) yyterminate(); } %% /* C-comment ignoring routine -kre*/ static void ccomment(void) { int c = 0; /* log(L_NOTICE, "got comment"); */ while (1) { while ((c = input()) != '*' && c != EOF) if (c == '\n') ++lineno; if (c == '*') { while ((c = input()) == '*') /* Nothing */ ; if (c == '/') break; else if (c == '\n') ++lineno; } if (c == EOF) { YY_FATAL_ERROR("EOF in comment"); /* XXX hack alert this disables * the stupid unused function warning * gcc generates */ if (1 == 0) yy_fatal_error("EOF in comment"); break; } } } /* C-style .includes. This function will properly swap input conf buffers, * and lineno -kre */ static void cinclude(void) { char *p = NULL; if ((p = strchr(yytext, '<')) == NULL) *strchr(p = strchr(yytext, '"') + 1, '"') = '\0'; else *strchr(++p, '>') = '\0'; /* log(L_NOTICE, "got include %s!", c); */ /* do stacking and co. */ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) ilog(LOG_TYPE_IRCD, "Includes nested too deep in %s", p); else { FILE *tmp_fbfile_in = NULL; char filenamebuf[IRCD_BUFSIZE]; if (*p == '/') /* if it is an absolute path */ snprintf(filenamebuf, sizeof(filenamebuf), "%s", p); else snprintf(filenamebuf, sizeof(filenamebuf), "%s/%s", ETCPATH, p); tmp_fbfile_in = fopen(filenamebuf, "r"); if (tmp_fbfile_in == NULL) { ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", filenamebuf, strerror(errno)); return; } lineno_stack[include_stack_ptr] = lineno; lineno = 1; inc_fbfile_in[include_stack_ptr] = conf_parser_ctx.conf_file; strlcpy(conffile_stack[include_stack_ptr], conffilebuf, IRCD_BUFSIZE); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; conf_parser_ctx.conf_file = tmp_fbfile_in; snprintf(conffilebuf, sizeof(conffilebuf), "%s", filenamebuf); yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); } } /* This is function that will be called on EOF in conf file. It will * apropriately close conf if it not main conf and swap input buffers -kre * */ static int ieof(void) { /* log(L_NOTICE, "return from include stack!"); */ if (include_stack_ptr) fclose(conf_parser_ctx.conf_file); if (--include_stack_ptr < 0) { /* log(L_NOTICE, "terminating lexer"); */ /* We will now exit the lexer - restore init values if we get /rehash * later and reenter lexer -kre */ include_stack_ptr = 0; lineno = 1; return 1; } /* switch buffer */ /* log(L_NOTICE, "deleting include_stack_ptr=%d", include_stack_ptr); */ yy_delete_buffer(YY_CURRENT_BUFFER); lineno = lineno_stack[include_stack_ptr]; conf_parser_ctx.conf_file = inc_fbfile_in[include_stack_ptr]; strlcpy(conffilebuf, conffile_stack[include_stack_ptr], sizeof(conffilebuf)); yy_switch_to_buffer(include_stack[include_stack_ptr]); return 0; } ircd-hybrid-8.1.13.dfsg.1/src/rng_mt.c0000644000175000017500000001160312263053413015426 0ustar domdom/* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) $Id: rng_mt.c 1662 2012-11-17 20:11:33Z michael $ */ #include "stdinc.h" #include "rng_mt.h" /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfU /* constant vector a */ #define UPPER_MASK 0x80000000U /* most significant w-r bits */ #define LOWER_MASK 0x7fffffffU /* least significant r bits */ static uint32_t mt[N]; /* the array for the state vector */ static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */ /* initializes mt[N] with a seed */ void init_genrand(uint32_t s) { mt[0] = s & 0xffffffffU; for (mti = 1; mti < N; mti++) { mt[mti] = (1812433253U * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ mt[mti] &= 0xffffffffU; /* for >32 bit machines */ } } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ /* slight change for C++, 2004/2/26 */ void init_by_array(uint32_t init_key[], int key_length) { int i, j, k; init_genrand(19650218U); i = 1; j = 0; k = (N > key_length ? N : key_length); for (; k; k--) { mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525U)) + init_key[j] + j; /* non linear */ mt[i] &= 0xffffffffU; /* for WORDSIZE > 32 machines */ i++; j++; if (i >= N) { mt[0] = mt[N - 1]; i = 1; } if (j >= key_length) j = 0; } for (k = N - 1; k; k--) { mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941U)) - i; /* non linear */ mt[i] &= 0xffffffffU; /* for WORDSIZE > 32 machines */ i++; if (i >= N) { mt[0] = mt[N - 1]; i = 1; } } mt[0] = 0x80000000U; /* MSB is 1; assuring non-zero initial array */ } /* generates a random number on [0,0xffffffff]-interval */ uint32_t genrand_int32(void) { uint32_t y; static uint32_t mag01[2]={ 0x0U, MATRIX_A }; /* mag01[x] = x * MATRIX_A for x=0,1 */ if (mti >= N) { /* generate N words at one time */ int kk; if (mti == N + 1) /* if init_genrand() has not been called, */ init_genrand(5489U); /* a default initial seed is used */ for (kk = 0; kk < N - M; kk++) { y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK); mt[kk] = mt[kk + M] ^ (y >> 1) ^ mag01[y & 0x1U]; } for (; kk < N - 1; kk++) { y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK); mt[kk] = mt[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1U]; } y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK); mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ mag01[y & 0x1U]; mti = 0; } y = mt[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680U; y ^= (y << 15) & 0xefc60000U; y ^= (y >> 18); return y; } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd_epoll.c0000644000175000017500000001372512263053413016434 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd_epoll.c: Linux epoll() compatible network routines. * * Copyright (C) 2002-2005 Hybrid Development Team * Based also on work of Adrian Chadd, Aaron Sethman and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd_epoll.c 2724 2013-12-29 13:00:42Z michael $ */ #include "stdinc.h" #if USE_IOPOLL_MECHANISM == __IOPOLL_MECHANISM_EPOLL #include "fdlist.h" #include "ircd.h" #include "memory.h" #include "s_bsd.h" #include "log.h" #include #include static fde_t efd; /* Thanks to ircu for the following ifdefs. */ /* The GNU C library may have a valid header but stub implementations * of the epoll system calls. If so, provide our own. */ #if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY) /* Oh, did we mention that some glibc releases do not even define the * syscall numbers? */ #if !defined(__NR_epoll_create) #if defined(__ia64__) #define __NR_epoll_create 1243 #define __NR_epoll_ctl 1244 #define __NR_epoll_wait 1245 #elif defined(__x86_64__) #define __NR_epoll_create 214 #define __NR_epoll_ctl 233 #define __NR_epoll_wait 232 #elif defined(__sparc64__) || defined(__sparc__) #define __NR_epoll_create 193 #define __NR_epoll_ctl 194 #define __NR_epoll_wait 195 #elif defined(__s390__) || defined(__m68k__) #define __NR_epoll_create 249 #define __NR_epoll_ctl 250 #define __NR_epoll_wait 251 #elif defined(__ppc64__) || defined(__ppc__) #define __NR_epoll_create 236 #define __NR_epoll_ctl 237 #define __NR_epoll_wait 238 #elif defined(__parisc__) || defined(__arm26__) || defined(__arm__) #define __NR_epoll_create 224 #define __NR_epoll_ctl 225 #define __NR_epoll_wait 226 #elif defined(__alpha__) #define __NR_epoll_create 407 #define __NR_epoll_ctl 408 #define __NR_epoll_wait 409 #elif defined(__sh64__) #define __NR_epoll_create 282 #define __NR_epoll_ctl 283 #define __NR_epoll_wait 284 #elif defined(__i386__) || defined(__sh__) || defined(__m32r__) || defined(__h8300__) || defined(__frv__) #define __NR_epoll_create 254 #define __NR_epoll_ctl 255 #define __NR_epoll_wait 256 #else /* cpu types */ #error No system call numbers defined for epoll family. #endif /* cpu types */ #endif /* !defined(__NR_epoll_create) */ _syscall1(int, epoll_create, int, size) _syscall4(int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event) _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, pevents, int, maxevents, int, timeout) #endif /* epoll_create defined as stub */ /* * init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ void init_netio(void) { int fd; if ((fd = epoll_create(hard_fdlimit)) < 0) { ilog(LOG_TYPE_IRCD, "init_netio: Couldn't open epoll fd - %d: %s", errno, strerror(errno)); exit(115); /* Whee! */ } fd_open(&efd, fd, 0, "epoll file descriptor"); } /* * comm_setselect * * This is a needed exported function which will be called to register * and deregister interest in a pending IO state for a given FD. */ void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) { int new_events, op; struct epoll_event ep_event = { 0, { 0 } }; if ((type & COMM_SELECT_READ)) { F->read_handler = handler; F->read_data = client_data; } if ((type & COMM_SELECT_WRITE)) { F->write_handler = handler; F->write_data = client_data; } new_events = (F->read_handler ? EPOLLIN : 0) | (F->write_handler ? EPOLLOUT : 0); if (timeout != 0) { F->timeout = CurrentTime + (timeout / 1000); F->timeout_handler = handler; F->timeout_data = client_data; } if (new_events != F->evcache) { if (new_events == 0) op = EPOLL_CTL_DEL; else if (F->evcache == 0) op = EPOLL_CTL_ADD; else op = EPOLL_CTL_MOD; ep_event.events = F->evcache = new_events; ep_event.data.fd = F->fd; if (epoll_ctl(efd.fd, op, F->fd, &ep_event) != 0) { ilog(LOG_TYPE_IRCD, "comm_setselect: epoll_ctl() failed: %s", strerror(errno)); abort(); } } } /* * comm_select() * * Called to do the new-style IO, courtesy of of squid (like most of this * new IO code). This routine handles the stuff we've hidden in * comm_setselect and fd_table[] and calls callbacks for IO ready * events. */ void comm_select(void) { struct epoll_event ep_fdlist[128]; int num, i; PF *hdl; fde_t *F; num = epoll_wait(efd.fd, ep_fdlist, 128, SELECT_DELAY); set_time(); if (num < 0) { #ifdef HAVE_USLEEP usleep(50000); /* avoid 99% CPU in comm_select */ #endif return; } for (i = 0; i < num; i++) { F = lookup_fd(ep_fdlist[i].data.fd); if (F == NULL || !F->flags.open) continue; if ((ep_fdlist[i].events & (EPOLLIN | EPOLLHUP | EPOLLERR))) { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); if (!F->flags.open) continue; } } if ((ep_fdlist[i].events & (EPOLLOUT | EPOLLHUP | EPOLLERR))) { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); if (!F->flags.open) continue; } } comm_setselect(F, 0, NULL, NULL, 0); } } #endif ircd-hybrid-8.1.13.dfsg.1/src/conf_db.c0000644000175000017500000005307612263053413015544 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 1996-2009 by Andrew Church * Copyright (C) 2012 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file conf_db.c * \brief Includes file utilities for database handling * \version $Id: conf_db.c 2173 2013-06-03 19:40:02Z michael $ */ #include "stdinc.h" #include "conf_db.h" #include "memory.h" #include "log.h" #include "send.h" #include "irc_string.h" #include "conf.h" #include "hostmask.h" #include "resv.h" /*! \brief Return the version number on the file. Return 0 if there is no version * number or the number doesn't make sense (i.e. less than 1 or greater * than FILE_VERSION). * * \param f dbFile Struct Member * \return int 0 if failure, 1 > is the version number */ uint32_t get_file_version(struct dbFILE *f) { uint32_t version = 0; if (read_uint32(&version, f) == -1) { ilog(LOG_TYPE_IRCD, "Error reading version number on %s: %s", f->filename, strerror(errno)); return 0; } if (version < 1) { ilog(LOG_TYPE_IRCD, "Invalid version number (%u) on %s", version, f->filename); return 0; } return version; } /*! \brief Write the current version number to the file. * \param f dbFile Struct Member * \return 0 on error, 1 on success. */ int write_file_version(struct dbFILE *f, uint32_t version) { if (write_uint32(version, f) == -1) { ilog(LOG_TYPE_IRCD, "Error writing version number on %s", f->filename); return 0; } return 1; } /*! \brief Open the database for reading * \param service If error whom to return the error as * \param filename File to open as the database * \return dbFile struct */ static struct dbFILE * open_db_read(const char *filename) { struct dbFILE *f = MyMalloc(sizeof(*f)); FILE *fp = NULL; strlcpy(f->filename, filename, sizeof(f->filename)); f->mode = 'r'; fp = fopen(f->filename, "rb"); if (!fp) { int errno_save = errno; if (errno != ENOENT) ilog(LOG_TYPE_IRCD, "Can't read database file %s", f->filename); MyFree(f); errno = errno_save; return NULL; } f->fp = fp; return f; } /*! \brief Open the database for writting * \param filename File to open as the database * \param version Database Version * \return dbFile struct */ static struct dbFILE * open_db_write(const char *filename, uint32_t version) { struct dbFILE *f = MyMalloc(sizeof(*f)); int fd = 0; strlcpy(f->filename, filename, sizeof(f->filename)); filename = f->filename; f->mode = 'w'; snprintf(f->tempname, sizeof(f->tempname), "%s.new", filename); if (f->tempname[0] == '\0' || !strcmp(f->tempname, filename)) { ilog(LOG_TYPE_IRCD, "Opening database file %s for write: Filename too long", filename); MyFree(f); errno = ENAMETOOLONG; return NULL; } remove(f->tempname); /* Use open() to avoid people sneaking a new file in under us */ fd = open(f->tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); if (fd >= 0) f->fp = fdopen(fd, "wb"); if (!f->fp || !write_file_version(f, version)) { int errno_save = errno; static int walloped = 0; if (!walloped++) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Can't create temporary database file %s", f->tempname); errno = errno_save; ilog(LOG_TYPE_IRCD, "Can't create temporary database file %s", f->tempname); if (f->fp) fclose(f->fp); remove(f->tempname); MyFree(f); errno = errno_save; return NULL; } return f; } /*! \brief Open a database file for reading (*mode == 'r') or writing (*mode == 'w'). * Return the stream pointer, or NULL on error. When opening for write, the * file actually opened is a temporary file, which will be renamed to the * original file on close. * * `version' is only used when opening a file for writing, and indicates the * version number to write to the file. * * \param filename File to open as the database * \param mode Mode for writting or reading * \param version Database Version * \return dbFile struct */ struct dbFILE * open_db(const char *filename, const char *mode, uint32_t version) { switch (*mode) { case 'r': return open_db_read(filename); break; case 'w': return open_db_write(filename, version); break; default: errno = EINVAL; return NULL; } } /*! \brief Restore the database file to its condition before open_db(). This is * identical to close_db() for files open for reading; however, for files * open for writing, we discard the new temporary file instead of renaming * it over the old file. The value of errno is preserved. * * \param dbFile struct */ void restore_db(struct dbFILE *f) { int errno_save = errno; if (f->fp) fclose(f->fp); if (f->mode == 'w' && f->tempname[0]) remove(f->tempname); MyFree(f); errno = errno_save; } /*! \brief Close a database file. If the file was opened for write, moves the new * file over the old one, and logs/wallops an error message if the rename() * fails. * * \param dbFile struct */ int close_db(struct dbFILE *f) { int res; if (!f->fp) { errno = EINVAL; return -1; } res = fclose(f->fp); f->fp = NULL; if (res != 0) return -1; if (f->mode == 'w' && f->tempname[0] && strcmp(f->tempname, f->filename)) { if (rename(f->tempname, f->filename) < 0) { int errno_save = errno; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Unable to move new " "data to database file %s; new data NOT saved.", f->filename); errno = errno_save; ilog(LOG_TYPE_IRCD, "Unable to move new data to database file %s; new " "data NOT saved.", f->filename); remove(f->tempname); } } MyFree(f); return 0; } /* * Read and write 2-, 4- and 8-byte quantities, pointers, and strings. All * multibyte values are stored in big-endian order (most significant byte * first). A pointer is stored as a byte, either 0 if NULL or 1 if not, * and read pointers are returned as either (void *)0 or (void *)1. A * string is stored with a 2-byte unsigned length (including the trailing * \0) first; a length of 0 indicates that the string pointer is NULL. * Written strings are truncated silently at 4294967294 bytes, and are always * null-terminated. */ /*! \brief Read a unsigned 8bit integer * * \param ret 8bit integer to read * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_uint8(uint8_t*ret, struct dbFILE *f) { int c = fgetc(f->fp); if (c == EOF) return -1; *ret = c; return 0; } /*! \brief Write a 8bit integer * * \param ret 8bit integer to write * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_uint8(uint8_t val, struct dbFILE *f) { if (fputc(val, f->fp) == EOF) return -1; return 0; } /*! \brief Read a unsigned 8bit integer * * \param ret 8bit integer to read * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_uint16(uint16_t *ret, struct dbFILE *f) { int c1 = fgetc(f->fp); int c2 = fgetc(f->fp); if (c1 == EOF || c2 == EOF) return -1; *ret = c1 << 8 | c2; return 0; } /*! \brief Write a unsigned 16bit integer * * \param ret 16bit integer to write * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_uint16(uint16_t val, struct dbFILE *f) { if (fputc((val >> 8) & 0xFF, f->fp) == EOF || fputc(val & 0xFF, f->fp) == EOF) return -1; return 0; } /*! \brief Read a unsigned 32bit integer * * \param ret unsigned 32bit integer to read * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_uint32(uint32_t *ret, struct dbFILE *f) { int c1 = fgetc(f->fp); int c2 = fgetc(f->fp); int c3 = fgetc(f->fp); int c4 = fgetc(f->fp); if (c1 == EOF || c2 == EOF || c3 == EOF || c4 == EOF) return -1; *ret = c1 << 24 | c2 << 16 | c3 << 8 | c4; return 0; } /*! \brief Write a unsigned 32bit integer * * \param ret unsigned 32bit integer to write * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_uint32(uint32_t val, struct dbFILE *f) { if (fputc((val >> 24) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 16) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 8) & 0xFF, f->fp) == EOF) return -1; if (fputc((val) & 0xFF, f->fp) == EOF) return -1; return 0; } /*! \brief Read a unsigned 64bit integer * * \param ret unsigned 64bit integer to read * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_uint64(uint64_t *ret, struct dbFILE *f) { int64_t c1 = fgetc(f->fp); int64_t c2 = fgetc(f->fp); int64_t c3 = fgetc(f->fp); int64_t c4 = fgetc(f->fp); int64_t c5 = fgetc(f->fp); int64_t c6 = fgetc(f->fp); int64_t c7 = fgetc(f->fp); int64_t c8 = fgetc(f->fp); if (c1 == EOF || c2 == EOF || c3 == EOF || c4 == EOF || c5 == EOF || c6 == EOF || c7 == EOF || c8 == EOF) return -1; *ret = c1 << 56 | c2 << 48 | c3 << 40 | c4 << 32 | c5 << 24 | c6 << 16 | c7 << 8 | c8; return 0; } /*! \brief Write a unsigned 64bit integer * * \param ret unsigned 64bit integer to write * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_uint64(uint64_t val, struct dbFILE *f) { if (fputc((val >> 56) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 48) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 40) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 32) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 24) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 16) & 0xFF, f->fp) == EOF) return -1; if (fputc((val >> 8) & 0xFF, f->fp) == EOF) return -1; if (fputc((val) & 0xFF, f->fp) == EOF) return -1; return 0; } /*! \brief Read Pointer * * \param ret pointer to read * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_ptr(void **ret, struct dbFILE *f) { int c = fgetc(f->fp); if (c == EOF) return -1; *ret = (c ? (void *)1 : (void *)0); return 0; } /*! \brief Write Pointer * * \param ret pointer to write * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_ptr(const void *ptr, struct dbFILE *f) { if (fputc(ptr ? 1 : 0, f->fp) == EOF) return -1; return 0; } /*! \brief Read String * * \param ret string * \param dbFile struct * \return -1 on error, 0 otherwise. */ int read_string(char **ret, struct dbFILE *f) { char *s = NULL; uint32_t len = 0; if (read_uint32(&len, f) < 0) return -1; if (len == 0) { *ret = NULL; return 0; } s = MyMalloc(len); if (len != fread(s, 1, len, f->fp)) { MyFree(s); return -1; } *ret = s; return 0; } /*! \brief Write String * * \param ret string * \param dbFile struct * \return -1 on error, 0 otherwise. */ int write_string(const char *s, struct dbFILE *f) { uint32_t len = 0; if (!s) return write_uint32(0, f); len = strlen(s); if (len > 4294967294) len = 4294967294; if (write_uint32(len + 1, f) < 0) return -1; if (len > 0 && fwrite(s, 1, len, f->fp) != len) return -1; if (fputc(0, f->fp) == EOF) return -1; return 0; } #define SAFE_READ(x) do { \ if ((x) < 0) { \ break; \ } \ } while (0) #define SAFE_WRITE(x,db) do { \ if ((x) < 0) { \ restore_db(f); \ ilog(LOG_TYPE_IRCD, "Write error on %s", db); \ return; \ } \ } while (0) void save_kline_database(void) { uint32_t i = 0; uint32_t records = 0; struct dbFILE *f = NULL; dlink_node *ptr = NULL; if (!(f = open_db(KPATH, "w", KLINE_DB_VERSION))) return; for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_KLINE && IsConfDatabase(arec->conf)) ++records; } } SAFE_WRITE(write_uint32(records, f), KPATH); for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_KLINE && IsConfDatabase(arec->conf)) { SAFE_WRITE(write_string(arec->conf->user, f), KPATH); SAFE_WRITE(write_string(arec->conf->host, f), KPATH); SAFE_WRITE(write_string(arec->conf->reason, f), KPATH); SAFE_WRITE(write_uint64(arec->conf->setat, f), KPATH); SAFE_WRITE(write_uint64(arec->conf->until, f), KPATH); } } } close_db(f); } void load_kline_database(void) { struct dbFILE *f = NULL; struct MaskItem *conf = NULL; char *field_1 = NULL; char *field_2 = NULL; char *field_3 = NULL; uint32_t i = 0; uint32_t records = 0; uint64_t field_4 = 0; uint64_t field_5 = 0; if (!(f = open_db(KPATH, "r", KLINE_DB_VERSION))) return; if (get_file_version(f) < 1) { close_db(f); return; } read_uint32(&records, f); for (i = 0; i < records; ++i) { SAFE_READ(read_string(&field_1, f)); SAFE_READ(read_string(&field_2, f)); SAFE_READ(read_string(&field_3, f)); SAFE_READ(read_uint64(&field_4, f)); SAFE_READ(read_uint64(&field_5, f)); conf = conf_make(CONF_KLINE); conf->user = field_1; conf->host = field_2; conf->reason = field_3; conf->setat = field_4; conf->until = field_5; SetConfDatabase(conf); add_conf_by_address(CONF_KLINE, conf); } close_db(f); } void save_dline_database(void) { uint32_t i = 0; uint32_t records = 0; struct dbFILE *f = NULL; dlink_node *ptr = NULL; if (!(f = open_db(DLPATH, "w", KLINE_DB_VERSION))) return; for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_DLINE && IsConfDatabase(arec->conf)) ++records; } } SAFE_WRITE(write_uint32(records, f), DLPATH); for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_DLINE && IsConfDatabase(arec->conf)) { SAFE_WRITE(write_string(arec->conf->host, f), DLPATH); SAFE_WRITE(write_string(arec->conf->reason, f), DLPATH); SAFE_WRITE(write_uint64(arec->conf->setat, f), DLPATH); SAFE_WRITE(write_uint64(arec->conf->until, f), DLPATH); } } } close_db(f); } void load_dline_database(void) { struct dbFILE *f = NULL; struct MaskItem *conf = NULL; char *field_1 = NULL; char *field_2 = NULL; uint32_t i = 0; uint32_t records = 0; uint64_t field_3 = 0; uint64_t field_4 = 0; if (!(f = open_db(DLPATH, "r", KLINE_DB_VERSION))) return; if (get_file_version(f) < 1) { close_db(f); return; } read_uint32(&records, f); for (i = 0; i < records; ++i) { SAFE_READ(read_string(&field_1, f)); SAFE_READ(read_string(&field_2, f)); SAFE_READ(read_uint64(&field_3, f)); SAFE_READ(read_uint64(&field_4, f)); conf = conf_make(CONF_DLINE); conf->host = field_1; conf->reason = field_2; conf->setat = field_3; conf->until = field_4; SetConfDatabase(conf); add_conf_by_address(CONF_DLINE, conf); } close_db(f); } void save_gline_database(void) { uint32_t i = 0; uint32_t records = 0; struct dbFILE *f = NULL; dlink_node *ptr = NULL; if (!(f = open_db(GPATH, "w", KLINE_DB_VERSION))) return; for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_GLINE && IsConfDatabase(arec->conf)) ++records; } } SAFE_WRITE(write_uint32(records, f), GPATH); for (i = 0; i < ATABLE_SIZE; ++i) { DLINK_FOREACH(ptr, atable[i].head) { struct AddressRec *arec = ptr->data; if (arec->type == CONF_GLINE && IsConfDatabase(arec->conf)) { SAFE_WRITE(write_string(arec->conf->user, f), GPATH); SAFE_WRITE(write_string(arec->conf->host, f), GPATH); SAFE_WRITE(write_string(arec->conf->reason, f), GPATH); SAFE_WRITE(write_uint64(arec->conf->setat, f), GPATH); SAFE_WRITE(write_uint64(arec->conf->until, f), GPATH); } } } close_db(f); } void load_gline_database(void) { struct dbFILE *f = NULL; struct MaskItem *conf = NULL; char *field_1 = NULL; char *field_2 = NULL; char *field_3 = NULL; uint32_t i = 0; uint32_t records = 0; uint64_t field_4 = 0; uint64_t field_5 = 0; if (!(f = open_db(GPATH, "r", KLINE_DB_VERSION))) return; if (get_file_version(f) < 1) { close_db(f); return; } read_uint32(&records, f); for (i = 0; i < records; ++i) { SAFE_READ(read_string(&field_1, f)); SAFE_READ(read_string(&field_2, f)); SAFE_READ(read_string(&field_3, f)); SAFE_READ(read_uint64(&field_4, f)); SAFE_READ(read_uint64(&field_5, f)); conf = conf_make(CONF_GLINE); conf->user = field_1; conf->host = field_2; conf->reason = field_3; conf->setat = field_4; conf->until = field_5; SetConfDatabase(conf); add_conf_by_address(CONF_GLINE, conf); } close_db(f); } void save_resv_database(void) { uint32_t records = 0; struct dbFILE *f = NULL; dlink_node *ptr = NULL; struct MaskItem *conf = NULL; if (!(f = open_db(RESVPATH, "w", KLINE_DB_VERSION))) return; DLINK_FOREACH(ptr, cresv_items.head) { conf = ptr->data; if (IsConfDatabase(conf)) ++records; } DLINK_FOREACH(ptr, nresv_items.head) { conf = ptr->data; if (IsConfDatabase(conf)) ++records; } SAFE_WRITE(write_uint32(records, f), RESVPATH); DLINK_FOREACH(ptr, cresv_items.head) { conf = ptr->data; if (!IsConfDatabase(conf)) continue; SAFE_WRITE(write_string(conf->name, f), RESVPATH); SAFE_WRITE(write_string(conf->reason, f), RESVPATH); SAFE_WRITE(write_uint64(conf->setat, f), RESVPATH); SAFE_WRITE(write_uint64(conf->until, f), RESVPATH); } DLINK_FOREACH(ptr, nresv_items.head) { conf = ptr->data; if (!IsConfDatabase(conf)) continue; SAFE_WRITE(write_string(conf->name, f), RESVPATH); SAFE_WRITE(write_string(conf->reason, f), RESVPATH); SAFE_WRITE(write_uint64(conf->setat, f), RESVPATH); SAFE_WRITE(write_uint64(conf->until, f), RESVPATH); } close_db(f); } void load_resv_database(void) { uint32_t i = 0; uint32_t records = 0; uint64_t tmp64_hold = 0, tmp64_setat = 0; struct dbFILE *f = NULL; char *name = NULL; char *reason = NULL; struct MaskItem *conf = NULL; if (!(f = open_db(RESVPATH, "r", KLINE_DB_VERSION))) return; if (get_file_version(f) < 1) { close_db(f); return; } read_uint32(&records, f); for (i = 0; i < records; ++i) { SAFE_READ(read_string(&name, f)); SAFE_READ(read_string(&reason, f)); SAFE_READ(read_uint64(&tmp64_setat, f)); SAFE_READ(read_uint64(&tmp64_hold, f)); if ((conf = create_resv(name, reason, NULL)) == NULL) continue; conf->setat = tmp64_setat; conf->until = tmp64_hold; SetConfDatabase(conf); MyFree(name); MyFree(reason); } close_db(f); } void save_xline_database(void) { uint32_t records = 0; struct dbFILE *f = NULL; dlink_node *ptr = NULL; struct MaskItem *conf = NULL; if (!(f = open_db(XPATH, "w", KLINE_DB_VERSION))) return; DLINK_FOREACH(ptr, xconf_items.head) { conf = ptr->data; if (IsConfDatabase(conf)) ++records; } SAFE_WRITE(write_uint32(records, f), XPATH); DLINK_FOREACH(ptr, xconf_items.head) { conf = ptr->data; if (!IsConfDatabase(conf)) continue; SAFE_WRITE(write_string(conf->name, f), XPATH); SAFE_WRITE(write_string(conf->reason, f), XPATH); SAFE_WRITE(write_uint64(conf->setat, f), XPATH); SAFE_WRITE(write_uint64(conf->until, f), XPATH); } close_db(f); } void load_xline_database(void) { uint32_t i = 0; uint32_t records = 0; uint64_t tmp64_hold = 0, tmp64_setat = 0; struct dbFILE *f = NULL; char *name = NULL; char *reason = NULL; struct MaskItem *conf = NULL; if (!(f = open_db(XPATH, "r", KLINE_DB_VERSION))) return; if (get_file_version(f) < 1) { close_db(f); return; } read_uint32(&records, f); for (i = 0; i < records; ++i) { SAFE_READ(read_string(&name, f)); SAFE_READ(read_string(&reason, f)); SAFE_READ(read_uint64(&tmp64_setat, f)); SAFE_READ(read_uint64(&tmp64_hold, f)); conf = conf_make(CONF_XLINE); SetConfDatabase(conf); conf->name = name; conf->reason = reason; conf->setat = tmp64_setat; conf->until = tmp64_hold; } close_db(f); } void save_all_databases(void *unused) { save_kline_database(); save_dline_database(); save_gline_database(); save_xline_database(); save_resv_database(); } ircd-hybrid-8.1.13.dfsg.1/src/packet.c0000644000175000017500000002447412263053413015421 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * packet.c: Packet handlers. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: packet.c 1798 2013-03-31 17:09:50Z michael $ */ #include "stdinc.h" #include "list.h" #include "s_bsd.h" #include "conf.h" #include "s_serv.h" #include "client.h" #include "ircd.h" #include "parse.h" #include "fdlist.h" #include "packet.h" #include "irc_string.h" #include "memory.h" #include "hook.h" #include "send.h" #include "s_misc.h" #define READBUF_SIZE 16384 static char readBuf[READBUF_SIZE]; static void client_dopacket(struct Client *, char *, size_t); /* extract_one_line() * * inputs - pointer to a dbuf queue * - pointer to buffer to copy data to * output - length of * side effects - one line is copied and removed from the dbuf */ static int extract_one_line(struct dbuf_queue *qptr, char *buffer) { struct dbuf_block *block; int line_bytes = 0, empty_bytes = 0, phase = 0; unsigned int idx; char c; dlink_node *ptr; /* * Phase 0: "empty" characters before the line * Phase 1: copying the line * Phase 2: "empty" characters after the line * (delete them as well and free some space in the dbuf) * * Empty characters are CR, LF and space (but, of course, not * in the middle of a line). We try to remove as much of them as we can, * since they simply eat server memory. * * --adx */ DLINK_FOREACH(ptr, qptr->blocks.head) { block = ptr->data; for (idx = 0; idx < block->size; idx++) { c = block->data[idx]; if (IsEol(c) || (c == ' ' && phase != 1)) { empty_bytes++; if (phase == 1) phase = 2; } else switch (phase) { case 0: phase = 1; case 1: if (line_bytes++ < IRCD_BUFSIZE - 2) *buffer++ = c; break; case 2: *buffer = '\0'; dbuf_delete(qptr, line_bytes + empty_bytes); return IRCD_MIN(line_bytes, IRCD_BUFSIZE - 2); } } } /* * Now, if we haven't reached phase 2, ignore all line bytes * that we have read, since this is a partial line case. */ if (phase != 2) line_bytes = 0; else *buffer = '\0'; /* Remove what is now unnecessary */ dbuf_delete(qptr, line_bytes + empty_bytes); return IRCD_MIN(line_bytes, IRCD_BUFSIZE - 2); } /* * parse_client_queued - parse client queued messages */ static void parse_client_queued(struct Client *client_p) { int dolen = 0; int checkflood = 1; struct LocalUser *lclient_p = client_p->localClient; if (IsUnknown(client_p)) { int i = 0; for(;;) { if (IsDefunct(client_p)) return; /* rate unknown clients at MAX_FLOOD per loop */ if (i >= MAX_FLOOD) break; dolen = extract_one_line(&lclient_p->buf_recvq, readBuf); if (dolen == 0) break; client_dopacket(client_p, readBuf, dolen); i++; /* if they've dropped out of the unknown state, break and move * to the parsing for their appropriate status. --fl */ if(!IsUnknown(client_p)) break; } } if (IsServer(client_p) || IsConnecting(client_p) || IsHandshake(client_p)) { while (1) { if (IsDefunct(client_p)) return; if ((dolen = extract_one_line(&lclient_p->buf_recvq, readBuf)) == 0) break; client_dopacket(client_p, readBuf, dolen); } } else if (IsClient(client_p)) { if (ConfigFileEntry.no_oper_flood && (HasUMode(client_p, UMODE_OPER) || IsCanFlood(client_p))) { if (ConfigFileEntry.true_no_oper_flood) checkflood = -1; else checkflood = 0; } /* * Handle flood protection here - if we exceed our flood limit on * messages in this loop, we simply drop out of the loop prematurely. * -- adrian */ for (;;) { if (IsDefunct(client_p)) break; /* This flood protection works as follows: * * A client is given allow_read lines to send to the server. Every * time a line is parsed, sent_parsed is increased. sent_parsed * is decreased by 1 every time flood_recalc is called. * * Thus a client can 'burst' allow_read lines to the server, any * excess lines will be parsed one per flood_recalc() call. * * Therefore a client will be penalised more if they keep flooding, * as sent_parsed will always hover around the allow_read limit * and no 'bursts' will be permitted. */ if (checkflood > 0) { if(lclient_p->sent_parsed >= lclient_p->allow_read) break; } /* allow opers 4 times the amount of messages as users. why 4? * why not. :) --fl_ */ else if (lclient_p->sent_parsed >= (4 * lclient_p->allow_read) && checkflood != -1) break; dolen = extract_one_line(&lclient_p->buf_recvq, readBuf); if (dolen == 0) break; client_dopacket(client_p, readBuf, dolen); lclient_p->sent_parsed++; } } } /* flood_endgrace() * * marks the end of the clients grace period */ void flood_endgrace(struct Client *client_p) { SetFloodDone(client_p); /* Drop their flood limit back down */ client_p->localClient->allow_read = MAX_FLOOD; /* sent_parsed could be way over MAX_FLOOD but under MAX_FLOOD_BURST, * so reset it. */ client_p->localClient->sent_parsed = 0; } /* * flood_recalc * * recalculate the number of allowed flood lines. this should be called * once a second on any given client. We then attempt to flush some data. */ void flood_recalc(fde_t *fd, void *data) { struct Client *client_p = data; struct LocalUser *lclient_p = client_p->localClient; /* allow a bursting client their allocation per second, allow * a client whos flooding an extra 2 per second */ if (IsFloodDone(client_p)) lclient_p->sent_parsed -= 2; else lclient_p->sent_parsed = 0; if (lclient_p->sent_parsed < 0) lclient_p->sent_parsed = 0; parse_client_queued(client_p); /* And now, try flushing .. */ if (!IsDead(client_p)) { /* and finally, reset the flood check */ comm_setflush(fd, 1000, flood_recalc, client_p); } } /* * read_packet - Read a 'packet' of data from a connection and process it. */ void read_packet(fde_t *fd, void *data) { struct Client *client_p = data; int length = 0; if (IsDefunct(client_p)) return; /* * Read some data. We *used to* do anti-flood protection here, but * I personally think it makes the code too hairy to make sane. * -- adrian */ do { #ifdef HAVE_LIBCRYPTO if (fd->ssl) { length = SSL_read(fd->ssl, readBuf, READBUF_SIZE); /* translate openssl error codes, sigh */ if (length < 0) switch (SSL_get_error(fd->ssl, length)) { case SSL_ERROR_WANT_WRITE: fd->flags.pending_read = 1; SetSendqBlocked(client_p); comm_setselect(fd, COMM_SELECT_WRITE, (PF *) sendq_unblocked, client_p, 0); return; case SSL_ERROR_WANT_READ: errno = EWOULDBLOCK; case SSL_ERROR_SYSCALL: break; case SSL_ERROR_SSL: if (errno == EAGAIN) break; default: length = errno = 0; } } else #endif { length = recv(fd->fd, readBuf, READBUF_SIZE, 0); } if (length <= 0) { /* * If true, then we can recover from this error. Just jump out of * the loop and re-register a new io-request. */ if (length < 0 && ignoreErrno(errno)) break; dead_link_on_read(client_p, length); return; } dbuf_put(&client_p->localClient->buf_recvq, readBuf, length); if (client_p->localClient->lasttime < CurrentTime) client_p->localClient->lasttime = CurrentTime; if (client_p->localClient->lasttime > client_p->localClient->since) client_p->localClient->since = CurrentTime; ClearPingSent(client_p); /* Attempt to parse what we have */ parse_client_queued(client_p); if (IsDefunct(client_p)) return; /* Check to make sure we're not flooding */ if (!(IsServer(client_p) || IsHandshake(client_p) || IsConnecting(client_p)) && (dbuf_length(&client_p->localClient->buf_recvq) > get_recvq(&client_p->localClient->confs))) { if (!(ConfigFileEntry.no_oper_flood && HasUMode(client_p, UMODE_OPER))) { exit_client(client_p, client_p, "Excess Flood"); return; } } } #ifdef HAVE_LIBCRYPTO while (length == sizeof(readBuf) || fd->ssl); #else while (length == sizeof(readBuf)); #endif /* If we get here, we need to register for another COMM_SELECT_READ */ comm_setselect(fd, COMM_SELECT_READ, read_packet, client_p, 0); } /* * client_dopacket - copy packet to client buf and parse it * client_p - pointer to client structure for which the buffer data * applies. * buffer - pointr to the buffer containing the newly read data * length - number of valid bytes of data in the buffer * * Note: * It is implicitly assumed that dopacket is called only * with client_p of "local" variation, which contains all the * necessary fields (buffer etc..) */ static void client_dopacket(struct Client *client_p, char *buffer, size_t length) { /* * Update messages received */ ++me.localClient->recv.messages; ++client_p->localClient->recv.messages; /* * Update bytes received */ client_p->localClient->recv.bytes += length; me.localClient->recv.bytes += length; parse(client_p, buffer, buffer + length); } ircd-hybrid-8.1.13.dfsg.1/src/Makefile.in0000644000175000017500000006654212263053413016055 0ustar domdom# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ sbin_PROGRAMS = ircd$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ conf_parser.h conf_parser.c conf_lexer.c $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/gcc_stack_protect.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_ircd_OBJECTS = channel.$(OBJEXT) channel_mode.$(OBJEXT) \ client.$(OBJEXT) conf.$(OBJEXT) conf_class.$(OBJEXT) \ conf_db.$(OBJEXT) conf_parser.$(OBJEXT) conf_lexer.$(OBJEXT) \ dbuf.$(OBJEXT) event.$(OBJEXT) fdlist.$(OBJEXT) \ getopt.$(OBJEXT) hash.$(OBJEXT) hook.$(OBJEXT) \ hostmask.$(OBJEXT) irc_res.$(OBJEXT) irc_reslib.$(OBJEXT) \ irc_string.$(OBJEXT) ircd.$(OBJEXT) ircd_signal.$(OBJEXT) \ list.$(OBJEXT) listener.$(OBJEXT) log.$(OBJEXT) \ match.$(OBJEXT) memory.$(OBJEXT) mempool.$(OBJEXT) \ modules.$(OBJEXT) motd.$(OBJEXT) rng_mt.$(OBJEXT) \ numeric.$(OBJEXT) packet.$(OBJEXT) parse.$(OBJEXT) \ s_bsd_epoll.$(OBJEXT) s_bsd_poll.$(OBJEXT) \ s_bsd_devpoll.$(OBJEXT) s_bsd_kqueue.$(OBJEXT) \ s_bsd_select.$(OBJEXT) restart.$(OBJEXT) resv.$(OBJEXT) \ rsa.$(OBJEXT) s_auth.$(OBJEXT) s_bsd.$(OBJEXT) \ s_gline.$(OBJEXT) s_misc.$(OBJEXT) s_serv.$(OBJEXT) \ s_user.$(OBJEXT) send.$(OBJEXT) version.$(OBJEXT) \ watch.$(OBJEXT) whowas.$(OBJEXT) ircd_OBJECTS = $(am_ircd_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = ircd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ircd_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = SOURCES = $(ircd_SOURCES) DIST_SOURCES = $(ircd_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ ARGZ_H = @ARGZ_H@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBDIR = @LIBDIR@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALSTATEDIR = @LOCALSTATEDIR@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign AM_YFLAGS = -d AM_CPPFLAGS = $(LTDLINCL) -I$(top_srcdir)/include ircd_LDFLAGS = -export-dynamic ircd_LDADD = $(LIBLTDL) ircd_DEPENDENCIES = $(LTDLDEPS) ircd_SOURCES = channel.c \ channel_mode.c \ client.c \ conf.c \ conf_class.c \ conf_db.c \ conf_parser.y \ conf_lexer.l \ dbuf.c \ event.c \ fdlist.c \ getopt.c \ hash.c \ hook.c \ hostmask.c \ irc_res.c \ irc_reslib.c \ irc_string.c \ ircd.c \ ircd_signal.c \ list.c \ listener.c \ log.c \ match.c \ memory.c \ mempool.c \ modules.c \ motd.c \ rng_mt.c \ numeric.c \ packet.c \ parse.c \ s_bsd_epoll.c \ s_bsd_poll.c \ s_bsd_devpoll.c \ s_bsd_kqueue.c \ s_bsd_select.c \ restart.c \ resv.c \ rsa.c \ s_auth.c \ s_bsd.c \ s_gline.c \ s_misc.c \ s_serv.c \ s_user.c \ send.c \ version.c \ watch.c \ whowas.c all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list conf_parser.h: conf_parser.c @if test ! -f $@; then rm -f conf_parser.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) conf_parser.c; else :; fi ircd$(EXEEXT): $(ircd_OBJECTS) $(ircd_DEPENDENCIES) $(EXTRA_ircd_DEPENDENCIES) @rm -f ircd$(EXEEXT) $(AM_V_CCLD)$(ircd_LINK) $(ircd_OBJECTS) $(ircd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel_mode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_class.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_db.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_lexer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf_parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostmask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irc_res.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irc_reslib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irc_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ircd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ircd_signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numeric.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rng_mt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_auth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd_devpoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd_epoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd_kqueue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd_poll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_bsd_select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_gline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_serv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_user.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/whowas.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f conf_lexer.c -rm -f conf_parser.c -rm -f conf_parser.h clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ircd-hybrid-8.1.13.dfsg.1/src/s_serv.c0000644000175000017500000013033012263053413015440 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_serv.c: Server related functions. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_serv.c 2717 2013-12-25 13:43:34Z michael $ */ #include "stdinc.h" #ifdef HAVE_LIBCRYPTO #include #include "rsa.h" #endif #include "list.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "dbuf.h" #include "event.h" #include "fdlist.h" #include "hash.h" #include "irc_string.h" #include "ircd.h" #include "ircd_defs.h" #include "s_bsd.h" #include "numeric.h" #include "packet.h" #include "irc_res.h" #include "conf.h" #include "s_serv.h" #include "log.h" #include "s_misc.h" #include "s_user.h" #include "send.h" #include "memory.h" #include "channel.h" /* chcap_usage_counts stuff...*/ #include "parse.h" #define MIN_CONN_FREQ 300 dlink_list flatten_links; static dlink_list cap_list = { NULL, NULL, 0 }; static void server_burst(struct Client *); static void burst_all(struct Client *); static void send_tb(struct Client *client_p, struct Channel *chptr); static CNCB serv_connect_callback; static void burst_members(struct Client *, struct Channel *); /* * write_links_file * * inputs - void pointer which is not used * output - NONE * side effects - called from an event, write out list of linked servers * but in no particular order. */ void write_links_file(void *notused) { FILE *file = NULL; dlink_node *ptr = NULL, *ptr_next = NULL; char buff[IRCD_BUFSIZE] = { '\0' }; if ((file = fopen(LIPATH, "w")) == NULL) return; DLINK_FOREACH_SAFE(ptr, ptr_next, flatten_links.head) { dlinkDelete(ptr, &flatten_links); MyFree(ptr->data); free_dlink_node(ptr); } DLINK_FOREACH(ptr, global_serv_list.head) { const struct Client *target_p = ptr->data; /* * Skip hidden servers, aswell as ourselves, since we already send * ourselves in /links */ if (IsHidden(target_p) || IsMe(target_p)) continue; if (HasFlag(target_p, FLAGS_SERVICE) && ConfigServerHide.hide_services) continue; /* * Attempt to format the file in such a way it follows the usual links output * ie "servername uplink :hops info" * Mostly for aesthetic reasons - makes it look pretty in mIRC ;) * - madmax */ snprintf(buff, sizeof(buff), "%s %s :1 %s", target_p->name, me.name, target_p->info); dlinkAddTail(xstrdup(buff), make_dlink_node(), &flatten_links); snprintf(buff, sizeof(buff), "%s %s :1 %s\n", target_p->name, me.name, target_p->info); fputs(buff, file); } fclose(file); } void read_links_file(void) { FILE *file = NULL; char *p = NULL; char buff[IRCD_BUFSIZE] = { '\0' }; if ((file = fopen(LIPATH, "r")) == NULL) return; while (fgets(buff, sizeof(buff), file)) { if ((p = strchr(buff, '\n')) != NULL) *p = '\0'; dlinkAddTail(xstrdup(buff), make_dlink_node(), &flatten_links); } fclose(file); } /* hunt_server() * Do the basic thing in delivering the message (command) * across the relays to the specific server (server) for * actions. * * Note: The command is a format string and *MUST* be * of prefixed style (e.g. ":%s COMMAND %s ..."). * Command can have only max 8 parameters. * * server parv[server] is the parameter identifying the * target server. * * *WARNING* * parv[server] is replaced with the pointer to the * real servername from the matched client (I'm lazy * now --msa). * * returns: (see #defines) */ int hunt_server(struct Client *client_p, struct Client *source_p, const char *command, const int server, const int parc, char *parv[]) { struct Client *target_p = NULL; struct Client *target_tmp = NULL; dlink_node *ptr; int wilds; /* Assume it's me, if no server */ if (parc <= server || EmptyString(parv[server])) return HUNTED_ISME; if (!strcmp(parv[server], me.id) || !match(parv[server], me.name)) return HUNTED_ISME; /* These are to pickup matches that would cause the following * message to go in the wrong direction while doing quick fast * non-matching lookups. */ if (MyClient(source_p)) target_p = hash_find_client(parv[server]); else target_p = find_person(client_p, parv[server]); if (target_p) if (target_p->from == source_p->from && !MyConnect(target_p)) target_p = NULL; if (target_p == NULL && (target_p = hash_find_server(parv[server]))) if (target_p->from == source_p->from && !MyConnect(target_p)) target_p = NULL; wilds = has_wildcards(parv[server]); /* Again, if there are no wild cards involved in the server * name, use the hash lookup */ if (target_p == NULL) { if (!wilds) { if (!(target_p = hash_find_server(parv[server]))) { sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, parv[server]); return HUNTED_NOSUCH; } } else { DLINK_FOREACH(ptr, global_client_list.head) { target_tmp = ptr->data; if (!match(parv[server], target_tmp->name)) { if (target_tmp->from == source_p->from && !MyConnect(target_tmp)) continue; target_p = ptr->data; if (IsRegistered(target_p) && (target_p != client_p)) break; } } } } if (target_p != NULL) { if(!IsRegistered(target_p)) { sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, parv[server]); return HUNTED_NOSUCH; } if (IsMe(target_p) || MyClient(target_p)) return HUNTED_ISME; if (match(target_p->name, parv[server])) parv[server] = target_p->name; /* This is a little kludgy but should work... */ if (IsClient(source_p) && ((MyConnect(target_p) && IsCapable(target_p, CAP_TS6)) || (!MyConnect(target_p) && IsCapable(target_p->from, CAP_TS6)))) parv[0] = ID(source_p); sendto_one(target_p, command, parv[0], parv[1], parv[2], parv[3], parv[4], parv[5], parv[6], parv[7], parv[8]); return HUNTED_PASS; } sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, source_p->name, parv[server]); return HUNTED_NOSUCH; } /* try_connections() * * inputs - void pointer which is not used * output - NONE * side effects - * scan through configuration and try new connections. * Returns the calendar time when the next call to this * function should be made latest. (No harm done if this * is called earlier or later...) */ void try_connections(void *unused) { dlink_node *ptr = NULL; struct MaskItem *conf; int confrq; /* TODO: change this to set active flag to 0 when added to event! --Habeeb */ if (GlobalSetOptions.autoconn == 0) return; DLINK_FOREACH(ptr, server_items.head) { conf = ptr->data; assert(conf->type == CONF_SERVER); /* Also when already connecting! (update holdtimes) --SRB */ if (!conf->port ||!IsConfAllowAutoConn(conf)) continue; /* Skip this entry if the use of it is still on hold until * future. Otherwise handle this entry (and set it on hold * until next time). Will reset only hold times, if already * made one successfull connection... [this algorithm is * a bit fuzzy... -- msa >;) ] */ if (conf->until > CurrentTime) continue; if (conf->class == NULL) confrq = DEFAULT_CONNECTFREQUENCY; else { confrq = conf->class->con_freq; if (confrq < MIN_CONN_FREQ) confrq = MIN_CONN_FREQ; } conf->until = CurrentTime + confrq; /* Found a CONNECT config with port specified, scan clients * and see if this server is already connected? */ if (hash_find_server(conf->name) != NULL) continue; if (conf->class->ref_count < conf->class->max_total) { /* Go to the end of the list, if not already last */ if (ptr->next != NULL) { dlinkDelete(ptr, &server_items); dlinkAddTail(conf, &conf->node, &server_items); } if (find_servconn_in_progress(conf->name)) return; /* We used to only print this if serv_connect() actually * succeeded, but since comm_tcp_connect() can call the callback * immediately if there is an error, we were getting error messages * in the wrong order. SO, we just print out the activated line, * and let serv_connect() / serv_connect_callback() print an * error afterwards if it fails. * -- adrian */ if (ConfigServerHide.hide_server_ips) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Connection to %s activated.", conf->name); else sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Connection to %s[%s] activated.", conf->name, conf->host); serv_connect(conf, NULL); /* We connect only one at time... */ return; } } } int valid_servname(const char *name) { unsigned int length = 0; unsigned int dots = 0; const char *p = name; for (; *p; ++p) { if (!IsServChar(*p)) return 0; ++length; if (*p == '.') ++dots; } return dots != 0 && length <= HOSTLEN; } int check_server(const char *name, struct Client *client_p) { dlink_node *ptr; struct MaskItem *conf = NULL; struct MaskItem *server_conf = NULL; int error = -1; assert(client_p != NULL); /* loop through looking for all possible connect items that might work */ DLINK_FOREACH(ptr, server_items.head) { conf = ptr->data; if (match(name, conf->name)) continue; error = -3; /* XXX: Fix me for IPv6 */ /* XXX sockhost is the IPv4 ip as a string */ if (!match(conf->host, client_p->host) || !match(conf->host, client_p->sockhost)) { error = -2; if (!match_conf_password(client_p->localClient->passwd, conf)) return -2; if (!EmptyString(conf->certfp)) if (EmptyString(client_p->certfp) || strcasecmp(client_p->certfp, conf->certfp)) return -4; server_conf = conf; } } if (server_conf == NULL) return error; attach_conf(client_p, server_conf); if (server_conf != NULL) { struct sockaddr_in *v4; #ifdef IPV6 struct sockaddr_in6 *v6; #endif switch (server_conf->aftype) { #ifdef IPV6 case AF_INET6: v6 = (struct sockaddr_in6 *)&server_conf->addr; if (IN6_IS_ADDR_UNSPECIFIED(&v6->sin6_addr)) memcpy(&server_conf->addr, &client_p->localClient->ip, sizeof(struct irc_ssaddr)); break; #endif case AF_INET: v4 = (struct sockaddr_in *)&server_conf->addr; if (v4->sin_addr.s_addr == INADDR_NONE) memcpy(&server_conf->addr, &client_p->localClient->ip, sizeof(struct irc_ssaddr)); break; } } return 0; } /* add_capability() * * inputs - string name of CAPAB * - int flag of capability * output - NONE * side effects - Adds given capability name and bit mask to * current supported capabilities. This allows * modules to dynamically add or subtract their capability. */ void add_capability(const char *capab_name, int cap_flag, int add_to_default) { struct Capability *cap = MyMalloc(sizeof(*cap)); cap->name = xstrdup(capab_name); cap->cap = cap_flag; dlinkAdd(cap, &cap->node, &cap_list); if (add_to_default) default_server_capabs |= cap_flag; } /* delete_capability() * * inputs - string name of CAPAB * output - NONE * side effects - delete given capability from ones known. */ int delete_capability(const char *capab_name) { dlink_node *ptr; dlink_node *next_ptr; struct Capability *cap; DLINK_FOREACH_SAFE(ptr, next_ptr, cap_list.head) { cap = ptr->data; if (cap->cap != 0) { if (irccmp(cap->name, capab_name) == 0) { default_server_capabs &= ~(cap->cap); dlinkDelete(ptr, &cap_list); MyFree(cap->name); MyFree(cap); } } } return 0; } /* * find_capability() * * inputs - string name of capab to find * output - 0 if not found CAPAB otherwise * side effects - none */ unsigned int find_capability(const char *capab) { const dlink_node *ptr = NULL; DLINK_FOREACH(ptr, cap_list.head) { const struct Capability *cap = ptr->data; if (cap->cap && !irccmp(cap->name, capab)) return cap->cap; } return 0; } /* send_capabilities() * * inputs - Client pointer to send to * - int flag of capabilities that this server can send * output - NONE * side effects - send the CAPAB line to a server -orabidoo * */ void send_capabilities(struct Client *client_p, int cap_can_send) { struct Capability *cap=NULL; char msgbuf[IRCD_BUFSIZE]; char *t; int tl; dlink_node *ptr; t = msgbuf; DLINK_FOREACH(ptr, cap_list.head) { cap = ptr->data; if (cap->cap & (cap_can_send|default_server_capabs)) { tl = sprintf(t, "%s ", cap->name); t += tl; } } *(t - 1) = '\0'; sendto_one(client_p, "CAPAB :%s", msgbuf); } /* sendnick_TS() * * inputs - client (server) to send nick towards * - client to send nick for * output - NONE * side effects - NICK message is sent towards given client_p */ void sendnick_TS(struct Client *client_p, struct Client *target_p) { char ubuf[IRCD_BUFSIZE]; if (!IsClient(target_p)) return; send_umode(NULL, target_p, 0, SEND_UMODES, ubuf); if (ubuf[0] == '\0') { ubuf[0] = '+'; ubuf[1] = '\0'; } if (IsCapable(client_p, CAP_SVS)) { if (HasID(target_p) && IsCapable(client_p, CAP_TS6)) sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s %s :%s", target_p->servptr->id, target_p->name, target_p->hopcount + 1, (unsigned long) target_p->tsinfo, ubuf, target_p->username, target_p->host, (MyClient(target_p) && IsIPSpoof(target_p)) ? "0" : target_p->sockhost, target_p->id, target_p->svid, target_p->info); else sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %s :%s", target_p->name, target_p->hopcount + 1, (unsigned long) target_p->tsinfo, ubuf, target_p->username, target_p->host, target_p->servptr->name, target_p->svid, target_p->info); } else { if (HasID(target_p) && IsCapable(client_p, CAP_TS6)) sendto_one(client_p, ":%s UID %s %d %lu %s %s %s %s %s :%s", target_p->servptr->id, target_p->name, target_p->hopcount + 1, (unsigned long) target_p->tsinfo, ubuf, target_p->username, target_p->host, (MyClient(target_p) && IsIPSpoof(target_p)) ? "0" : target_p->sockhost, target_p->id, target_p->info); else sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s", target_p->name, target_p->hopcount + 1, (unsigned long) target_p->tsinfo, ubuf, target_p->username, target_p->host, target_p->servptr->name, target_p->info); } if (!EmptyString(target_p->certfp)) sendto_one(client_p, ":%s CERTFP %s", ID_or_name(target_p, client_p), target_p->certfp); if (target_p->away[0]) sendto_one(client_p, ":%s AWAY :%s", ID_or_name(target_p, client_p), target_p->away); } /* * show_capabilities - show current server capabilities * * inputs - pointer to a struct Client * output - pointer to static string * side effects - build up string representing capabilities of server listed */ const char * show_capabilities(const struct Client *target_p) { static char msgbuf[IRCD_BUFSIZE] = ""; const dlink_node *ptr = NULL; strlcpy(msgbuf, "TS", sizeof(msgbuf)); DLINK_FOREACH(ptr, cap_list.head) { const struct Capability *cap = ptr->data; if (!IsCapable(target_p, cap->cap)) continue; strlcat(msgbuf, " ", sizeof(msgbuf)); strlcat(msgbuf, cap->name, sizeof(msgbuf)); } return msgbuf; } /* make_server() * * inputs - pointer to client struct * output - pointer to struct Server * side effects - add's an Server information block to a client * if it was not previously allocated. */ struct Server * make_server(struct Client *client_p) { if (client_p->serv == NULL) client_p->serv = MyMalloc(sizeof(struct Server)); return client_p->serv; } /* server_estab() * * inputs - pointer to a struct Client * output - * side effects - */ void server_estab(struct Client *client_p) { struct Client *target_p; struct MaskItem *conf = NULL; char *host; const char *inpath; static char inpath_ip[HOSTLEN * 2 + USERLEN + 6]; dlink_node *ptr; #ifdef HAVE_LIBCRYPTO const COMP_METHOD *compression = NULL, *expansion = NULL; #endif assert(client_p != NULL); strlcpy(inpath_ip, get_client_name(client_p, SHOW_IP), sizeof(inpath_ip)); inpath = get_client_name(client_p, MASK_IP); /* "refresh" inpath with host */ host = client_p->name; if ((conf = find_conf_name(&client_p->localClient->confs, host, CONF_SERVER)) == NULL) { /* This shouldn't happen, better tell the ops... -A1kmm */ sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning: Lost connect{} block " "for server %s(this shouldn't happen)!", host); exit_client(client_p, &me, "Lost connect{} block!"); return; } MyFree(client_p->localClient->passwd); client_p->localClient->passwd = NULL; /* Its got identd, since its a server */ SetGotId(client_p); /* If there is something in the serv_list, it might be this * connecting server.. */ if (!ServerInfo.hub && serv_list.head) { if (client_p != serv_list.head->data || serv_list.head->next) { ++ServerStats.is_ref; sendto_one(client_p, "ERROR :I'm a leaf not a hub"); exit_client(client_p, &me, "I'm a leaf"); return; } } if (IsUnknown(client_p)) { sendto_one(client_p, "PASS %s TS %d %s", conf->spasswd, TS_CURRENT, me.id); send_capabilities(client_p, 0); sendto_one(client_p, "SERVER %s 1 :%s%s", me.name, ConfigServerHide.hidden ? "(H) " : "", me.info); } sendto_one(client_p, "SVINFO %d %d 0 :%lu", TS_CURRENT, TS_MIN, (unsigned long)CurrentTime); /* assumption here is if they passed the correct TS version, they also passed an SID */ if (IsCapable(client_p, CAP_TS6)) hash_add_id(client_p); /* XXX Does this ever happen? I don't think so -db */ detach_conf(client_p, CONF_OPER); /* *WARNING* ** In the following code in place of plain server's ** name we send what is returned by get_client_name ** which may add the "sockhost" after the name. It's ** *very* *important* that there is a SPACE between ** the name and sockhost (if present). The receiving ** server will start the information field from this ** first blank and thus puts the sockhost into info. ** ...a bit tricky, but you have been warned, besides ** code is more neat this way... --msa */ client_p->servptr = &me; if (IsClosing(client_p)) return; SetServer(client_p); /* Update the capability combination usage counts. -A1kmm */ set_chcap_usage_counts(client_p); /* Some day, all these lists will be consolidated *sigh* */ dlinkAdd(client_p, &client_p->lnode, &me.serv->server_list); assert(dlinkFind(&unknown_list, client_p)); dlink_move_node(&client_p->localClient->lclient_node, &unknown_list, &serv_list); Count.myserver++; dlinkAdd(client_p, make_dlink_node(), &global_serv_list); hash_add_client(client_p); /* doesnt duplicate client_p->serv if allocated this struct already */ make_server(client_p); /* fixing eob timings.. -gnp */ client_p->localClient->firsttime = CurrentTime; if (find_matching_name_conf(CONF_SERVICE, client_p->name, NULL, NULL, 0)) AddFlag(client_p, FLAGS_SERVICE); /* Show the real host/IP to admins */ #ifdef HAVE_LIBCRYPTO if (client_p->localClient->fd.ssl) { compression = SSL_get_current_compression(client_p->localClient->fd.ssl); expansion = SSL_get_current_expansion(client_p->localClient->fd.ssl); sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Link with %s established: [SSL: %s, Compression/Expansion method: %s/%s] (Capabilities: %s)", inpath_ip, ssl_get_cipher(client_p->localClient->fd.ssl), compression ? SSL_COMP_get_name(compression) : "NONE", expansion ? SSL_COMP_get_name(expansion) : "NONE", show_capabilities(client_p)); /* Now show the masked hostname/IP to opers */ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Link with %s established: [SSL: %s, Compression/Expansion method: %s/%s] (Capabilities: %s)", inpath, ssl_get_cipher(client_p->localClient->fd.ssl), compression ? SSL_COMP_get_name(compression) : "NONE", expansion ? SSL_COMP_get_name(expansion) : "NONE", show_capabilities(client_p)); ilog(LOG_TYPE_IRCD, "Link with %s established: [SSL: %s, Compression/Expansion method: %s/%s] (Capabilities: %s)", inpath_ip, ssl_get_cipher(client_p->localClient->fd.ssl), compression ? SSL_COMP_get_name(compression) : "NONE", expansion ? SSL_COMP_get_name(expansion) : "NONE", show_capabilities(client_p)); } else #endif { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Link with %s established: (Capabilities: %s)", inpath_ip, show_capabilities(client_p)); /* Now show the masked hostname/IP to opers */ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Link with %s established: (Capabilities: %s)", inpath, show_capabilities(client_p)); ilog(LOG_TYPE_IRCD, "Link with %s established: (Capabilities: %s)", inpath_ip, show_capabilities(client_p)); } fd_note(&client_p->localClient->fd, "Server: %s", client_p->name); /* Old sendto_serv_but_one() call removed because we now ** need to send different names to different servers ** (domain name matching) Send new server to other servers. */ DLINK_FOREACH(ptr, serv_list.head) { target_p = ptr->data; if (target_p == client_p) continue; if (IsCapable(target_p, CAP_TS6) && HasID(client_p)) sendto_one(target_p, ":%s SID %s 2 %s :%s%s", me.id, client_p->name, client_p->id, IsHidden(client_p) ? "(H) " : "", client_p->info); else sendto_one(target_p,":%s SERVER %s 2 :%s%s", me.name, client_p->name, IsHidden(client_p) ? "(H) " : "", client_p->info); } /* * Pass on my client information to the new server * * First, pass only servers (idea is that if the link gets * cancelled beacause the server was already there, * there are no NICK's to be cancelled...). Of course, * if cancellation occurs, all this info is sent anyway, * and I guess the link dies when a read is attempted...? --msa * * Note: Link cancellation to occur at this point means * that at least two servers from my fragment are building * up connection this other fragment at the same time, it's * a race condition, not the normal way of operation... * * ALSO NOTE: using the get_client_name for server names-- * see previous *WARNING*!!! (Also, original inpath * is destroyed...) */ DLINK_FOREACH_PREV(ptr, global_serv_list.tail) { target_p = ptr->data; /* target_p->from == target_p for target_p == client_p */ if (IsMe(target_p) || target_p->from == client_p) continue; if (IsCapable(client_p, CAP_TS6)) { if (HasID(target_p)) sendto_one(client_p, ":%s SID %s %d %s :%s%s", ID(target_p->servptr), target_p->name, target_p->hopcount+1, target_p->id, IsHidden(target_p) ? "(H) " : "", target_p->info); else /* introducing non-ts6 server */ sendto_one(client_p, ":%s SERVER %s %d :%s%s", ID(target_p->servptr), target_p->name, target_p->hopcount+1, IsHidden(target_p) ? "(H) " : "", target_p->info); } else sendto_one(client_p, ":%s SERVER %s %d :%s%s", target_p->servptr->name, target_p->name, target_p->hopcount+1, IsHidden(target_p) ? "(H) " : "", target_p->info); if (HasFlag(target_p, FLAGS_EOB)) sendto_one(client_p, ":%s EOB", ID_or_name(target_p, client_p)); } server_burst(client_p); } /* server_burst() * * inputs - struct Client pointer server * - * output - none * side effects - send a server burst * bugs - still too long */ static void server_burst(struct Client *client_p) { /* Send it in the shortened format with the TS, if ** it's a TS server; walk the list of channels, sending ** all the nicks that haven't been sent yet for each ** channel, then send the channel itself -- it's less ** obvious than sending all nicks first, but on the ** receiving side memory will be allocated more nicely ** saving a few seconds in the handling of a split ** -orabidoo */ burst_all(client_p); /* EOB stuff is now in burst_all */ /* Always send a PING after connect burst is done */ sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p)); } /* burst_all() * * inputs - pointer to server to send burst to * output - NONE * side effects - complete burst of channels/nicks is sent to client_p */ static void burst_all(struct Client *client_p) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, global_channel_list.head) { struct Channel *chptr = ptr->data; if (dlink_list_length(&chptr->members) != 0) { burst_members(client_p, chptr); send_channel_modes(client_p, chptr); if (IsCapable(client_p, CAP_TBURST)) send_tb(client_p, chptr); } } /* also send out those that are not on any channel */ DLINK_FOREACH(ptr, global_client_list.head) { struct Client *target_p = ptr->data; if (!HasFlag(target_p, FLAGS_BURSTED) && target_p->from != client_p) sendnick_TS(client_p, target_p); DelFlag(target_p, FLAGS_BURSTED); } if (IsCapable(client_p, CAP_EOB)) sendto_one(client_p, ":%s EOB", ID_or_name(&me, client_p)); } /* * send_tb * * inputs - pointer to Client * - pointer to channel * output - NONE * side effects - Called on a server burst when * server is CAP_TBURST capable */ static void send_tb(struct Client *client_p, struct Channel *chptr) { /* * We may also send an empty topic here, but only if topic_time isn't 0, * i.e. if we had a topic that got unset. This is required for syncing * topics properly. * * Imagine the following scenario: Our downlink introduces a channel * to us with a TS that is equal to ours, but the channel topic on * their side got unset while the servers were in splitmode, which means * their 'topic' is newer. They simply wanted to unset it, so we have to * deal with it in a more sophisticated fashion instead of just resetting * it to their old topic they had before. Read m_tburst.c:ms_tburst * for further information -Michael */ if (chptr->topic_time != 0) sendto_one(client_p, ":%s TBURST %lu %s %lu %s :%s", ID_or_name(&me, client_p), (unsigned long)chptr->channelts, chptr->chname, (unsigned long)chptr->topic_time, chptr->topic_info, chptr->topic); } /* burst_members() * * inputs - pointer to server to send members to * - dlink_list pointer to membership list to send * output - NONE * side effects - */ static void burst_members(struct Client *client_p, struct Channel *chptr) { struct Client *target_p; struct Membership *ms; dlink_node *ptr; DLINK_FOREACH(ptr, chptr->members.head) { ms = ptr->data; target_p = ms->client_p; if (!HasFlag(target_p, FLAGS_BURSTED)) { AddFlag(target_p, FLAGS_BURSTED); if (target_p->from != client_p) sendnick_TS(client_p, target_p); } } } /* New server connection code * Based upon the stuff floating about in s_bsd.c * -- adrian */ /* serv_connect() - initiate a server connection * * inputs - pointer to conf * - pointer to client doing the connect * output - * side effects - * * This code initiates a connection to a server. It first checks to make * sure the given server exists. If this is the case, it creates a socket, * creates a client, saves the socket information in the client, and * initiates a connection to the server through comm_connect_tcp(). The * completion of this goes through serv_completed_connection(). * * We return 1 if the connection is attempted, since we don't know whether * it suceeded or not, and 0 if it fails in here somewhere. */ int serv_connect(struct MaskItem *conf, struct Client *by) { struct Client *client_p; char buf[HOSTIPLEN + 1]; /* conversion structs */ struct sockaddr_in *v4; /* Make sure conf is useful */ assert(conf != NULL); getnameinfo((struct sockaddr *)&conf->addr, conf->addr.ss_len, buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); ilog(LOG_TYPE_IRCD, "Connect to %s[%s] @%s", conf->name, conf->host, buf); /* Still processing a DNS lookup? -> exit */ if (conf->dns_pending) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Error connecting to %s: DNS lookup for connect{} in progress.", conf->name); return (0); } if (conf->dns_failed) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Error connecting to %s: DNS lookup for connect{} failed.", conf->name); return (0); } /* Make sure this server isn't already connected * Note: conf should ALWAYS be a valid C: line */ if ((client_p = hash_find_server(conf->name)) != NULL) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Server %s already present from %s", conf->name, get_client_name(client_p, SHOW_IP)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Server %s already present from %s", conf->name, get_client_name(client_p, MASK_IP)); if (by && IsClient(by) && !MyClient(by)) sendto_one(by, ":%s NOTICE %s :Server %s already present from %s", me.name, by->name, conf->name, get_client_name(client_p, MASK_IP)); return 0; } /* Create a local client */ client_p = make_client(NULL); /* Copy in the server, hostname, fd */ strlcpy(client_p->name, conf->name, sizeof(client_p->name)); strlcpy(client_p->host, conf->host, sizeof(client_p->host)); /* We already converted the ip once, so lets use it - stu */ strlcpy(client_p->sockhost, buf, sizeof(client_p->sockhost)); /* create a socket for the server connection */ if (comm_open(&client_p->localClient->fd, conf->addr.ss.ss_family, SOCK_STREAM, 0, NULL) < 0) { /* Eek, failure to create the socket */ report_error(L_ALL, "opening stream socket to %s: %s", conf->name, errno); SetDead(client_p); exit_client(client_p, &me, "Connection failed"); return 0; } /* servernames are always guaranteed under HOSTLEN chars */ fd_note(&client_p->localClient->fd, "Server: %s", conf->name); /* Attach config entries to client here rather than in * serv_connect_callback(). This to avoid null pointer references. */ if (!attach_connect_block(client_p, conf->name, conf->host)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Host %s is not enabled for connecting: no connect{} block", conf->name); if (by && IsClient(by) && !MyClient(by)) sendto_one(by, ":%s NOTICE %s :Connect to host %s failed.", me.name, by->name, client_p->name); SetDead(client_p); exit_client(client_p, client_p, "Connection failed"); return 0; } /* at this point we have a connection in progress and C/N lines * attached to the client, the socket info should be saved in the * client and it should either be resolved or have a valid address. * * The socket has been connected or connect is in progress. */ make_server(client_p); if (by && IsClient(by)) strlcpy(client_p->serv->by, by->name, sizeof(client_p->serv->by)); else strlcpy(client_p->serv->by, "AutoConn.", sizeof(client_p->serv->by)); SetConnecting(client_p); dlinkAdd(client_p, &client_p->node, &global_client_list); /* from def_fam */ client_p->localClient->aftype = conf->aftype; /* Now, initiate the connection */ /* XXX assume that a non 0 type means a specific bind address * for this connect. */ switch (conf->aftype) { case AF_INET: v4 = (struct sockaddr_in*)&conf->bind; if (v4->sin_addr.s_addr != 0) { struct irc_ssaddr ipn; memset(&ipn, 0, sizeof(struct irc_ssaddr)); ipn.ss.ss_family = AF_INET; ipn.ss_port = 0; memcpy(&ipn, &conf->bind, sizeof(struct irc_ssaddr)); comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, (struct sockaddr *)&ipn, ipn.ss_len, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); } else if (ServerInfo.specific_ipv4_vhost) { struct irc_ssaddr ipn; memset(&ipn, 0, sizeof(struct irc_ssaddr)); ipn.ss.ss_family = AF_INET; ipn.ss_port = 0; memcpy(&ipn, &ServerInfo.ip, sizeof(struct irc_ssaddr)); comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, (struct sockaddr *)&ipn, ipn.ss_len, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); } else comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, NULL, 0, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); break; #ifdef IPV6 case AF_INET6: { struct irc_ssaddr ipn; struct sockaddr_in6 *v6; struct sockaddr_in6 *v6conf; memset(&ipn, 0, sizeof(struct irc_ssaddr)); v6conf = (struct sockaddr_in6 *)&conf->bind; v6 = (struct sockaddr_in6 *)&ipn; if (memcmp(&v6conf->sin6_addr, &v6->sin6_addr, sizeof(struct in6_addr)) != 0) { memcpy(&ipn, &conf->bind, sizeof(struct irc_ssaddr)); ipn.ss.ss_family = AF_INET6; ipn.ss_port = 0; comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, (struct sockaddr *)&ipn, ipn.ss_len, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); } else if (ServerInfo.specific_ipv6_vhost) { memcpy(&ipn, &ServerInfo.ip6, sizeof(struct irc_ssaddr)); ipn.ss.ss_family = AF_INET6; ipn.ss_port = 0; comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, (struct sockaddr *)&ipn, ipn.ss_len, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); } else comm_connect_tcp(&client_p->localClient->fd, conf->host, conf->port, NULL, 0, serv_connect_callback, client_p, conf->aftype, CONNECTTIMEOUT); } #endif } return 1; } #ifdef HAVE_LIBCRYPTO static void finish_ssl_server_handshake(struct Client *client_p) { struct MaskItem *conf = NULL; conf = find_conf_name(&client_p->localClient->confs, client_p->name, CONF_SERVER); if (conf == NULL) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Lost connect{} block for %s", get_client_name(client_p, HIDE_IP)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Lost connect{} block for %s", get_client_name(client_p, MASK_IP)); exit_client(client_p, &me, "Lost connect{} block"); return; } sendto_one(client_p, "PASS %s TS %d %s", conf->spasswd, TS_CURRENT, me.id); send_capabilities(client_p, 0); sendto_one(client_p, "SERVER %s 1 :%s%s", me.name, ConfigServerHide.hidden ? "(H) " : "", me.info); /* If we've been marked dead because a send failed, just exit * here now and save everyone the trouble of us ever existing. */ if (IsDead(client_p)) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "%s[%s] went dead during handshake", client_p->name, client_p->host); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "%s went dead during handshake", client_p->name); return; } /* don't move to serv_list yet -- we haven't sent a burst! */ /* If we get here, we're ok, so lets start reading some data */ comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ, read_packet, client_p, 0); } static void ssl_server_handshake(fde_t *fd, struct Client *client_p) { X509 *cert = NULL; int ret = 0; if ((ret = SSL_connect(client_p->localClient->fd.ssl)) <= 0) { switch (SSL_get_error(client_p->localClient->fd.ssl, ret)) { case SSL_ERROR_WANT_WRITE: comm_setselect(&client_p->localClient->fd, COMM_SELECT_WRITE, (PF *)ssl_server_handshake, client_p, 0); return; case SSL_ERROR_WANT_READ: comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ, (PF *)ssl_server_handshake, client_p, 0); return; default: { const char *sslerr = ERR_error_string(ERR_get_error(), NULL); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Error connecting to %s: %s", client_p->name, sslerr ? sslerr : "unknown SSL error"); exit_client(client_p, client_p, "Error during SSL handshake"); return; } } } if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl))) { int res = SSL_get_verify_result(client_p->localClient->fd.ssl); char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' }; unsigned char md[EVP_MAX_MD_SIZE] = { '\0' }; if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN || res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) { unsigned int i = 0, n = 0; if (X509_digest(cert, EVP_sha256(), md, &n)) { for (; i < n; ++i) snprintf(buf + 2 * i, 3, "%02X", md[i]); client_p->certfp = xstrdup(buf); } } else ilog(LOG_TYPE_IRCD, "Server %s!%s@%s gave bad SSL client certificate: %d", client_p->name, client_p->username, client_p->host, res); X509_free(cert); } finish_ssl_server_handshake(client_p); } static void ssl_connect_init(struct Client *client_p, struct MaskItem *conf, fde_t *fd) { if ((client_p->localClient->fd.ssl = SSL_new(ServerInfo.client_ctx)) == NULL) { ilog(LOG_TYPE_IRCD, "SSL_new() ERROR! -- %s", ERR_error_string(ERR_get_error(), NULL)); SetDead(client_p); exit_client(client_p, client_p, "SSL_new failed"); return; } SSL_set_fd(fd->ssl, fd->fd); if (!EmptyString(conf->cipher_list)) SSL_set_cipher_list(client_p->localClient->fd.ssl, conf->cipher_list); ssl_server_handshake(NULL, client_p); } #endif /* serv_connect_callback() - complete a server connection. * * This routine is called after the server connection attempt has * completed. If unsucessful, an error is sent to ops and the client * is closed. If sucessful, it goes through the initialisation/check * procedures, the capabilities are sent, and the socket is then * marked for reading. */ static void serv_connect_callback(fde_t *fd, int status, void *data) { struct Client *client_p = data; struct MaskItem *conf = NULL; /* First, make sure its a real client! */ assert(client_p != NULL); assert(&client_p->localClient->fd == fd); /* Next, for backward purposes, record the ip of the server */ memcpy(&client_p->localClient->ip, &fd->connect.hostaddr, sizeof(struct irc_ssaddr)); /* Check the status */ if (status != COMM_OK) { /* We have an error, so report it and quit * Admins get to see any IP, mere opers don't *sigh* */ if (ConfigServerHide.hide_server_ips) sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Error connecting to %s: %s", client_p->name, comm_errstr(status)); else sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Error connecting to %s[%s]: %s", client_p->name, client_p->host, comm_errstr(status)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Error connecting to %s: %s", client_p->name, comm_errstr(status)); /* If a fd goes bad, call dead_link() the socket is no * longer valid for reading or writing. */ dead_link_on_write(client_p, 0); return; } /* COMM_OK, so continue the connection procedure */ /* Get the C/N lines */ conf = find_conf_name(&client_p->localClient->confs, client_p->name, CONF_SERVER); if (conf == NULL) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Lost connect{} block for %s", get_client_name(client_p, HIDE_IP)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Lost connect{} block for %s", get_client_name(client_p, MASK_IP)); exit_client(client_p, &me, "Lost connect{} block"); return; } /* Next, send the initial handshake */ SetHandshake(client_p); #ifdef HAVE_LIBCRYPTO if (IsConfSSL(conf)) { ssl_connect_init(client_p, conf, fd); return; } #endif sendto_one(client_p, "PASS %s TS %d %s", conf->spasswd, TS_CURRENT, me.id); send_capabilities(client_p, 0); sendto_one(client_p, "SERVER %s 1 :%s%s", me.name, ConfigServerHide.hidden ? "(H) " : "", me.info); /* If we've been marked dead because a send failed, just exit * here now and save everyone the trouble of us ever existing. */ if (IsDead(client_p)) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "%s[%s] went dead during handshake", client_p->name, client_p->host); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "%s went dead during handshake", client_p->name); return; } /* don't move to serv_list yet -- we haven't sent a burst! */ /* If we get here, we're ok, so lets start reading some data */ comm_setselect(fd, COMM_SELECT_READ, read_packet, client_p, 0); } struct Client * find_servconn_in_progress(const char *name) { dlink_node *ptr; struct Client *cptr; DLINK_FOREACH(ptr, unknown_list.head) { cptr = ptr->data; if (cptr && cptr->name[0]) if (!match(name, cptr->name)) return cptr; } return NULL; } ircd-hybrid-8.1.13.dfsg.1/src/fdlist.c0000644000175000017500000001131512263053413015425 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * fdlist.c: Maintains a list of file descriptors. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: fdlist.c 1736 2013-01-13 09:31:46Z michael $ */ #include "stdinc.h" #include "fdlist.h" #include "client.h" /* struct Client */ #include "event.h" #include "ircd.h" /* GlobalSetOptions */ #include "irc_string.h" #include "s_bsd.h" /* comm_setselect */ #include "conf.h" /* ServerInfo */ #include "send.h" #include "memory.h" #include "numeric.h" #include "s_misc.h" #include "irc_res.h" fde_t *fd_hash[FD_HASH_SIZE]; fde_t *fd_next_in_loop = NULL; int number_fd = LEAKED_FDS; int hard_fdlimit = 0; static int set_fdlimit(void) { int fdmax; struct rlimit limit; if (!getrlimit(RLIMIT_NOFILE, &limit)) { limit.rlim_cur = limit.rlim_max; setrlimit(RLIMIT_NOFILE, &limit); } fdmax = getdtablesize(); /* allow MAXCLIENTS_MIN clients even at the cost of MAX_BUFFER and * some not really LEAKED_FDS */ fdmax = IRCD_MAX(fdmax, LEAKED_FDS + MAX_BUFFER + MAXCLIENTS_MIN); /* under no condition shall this raise over 65536 * for example user ip heap is sized 2*hard_fdlimit */ hard_fdlimit = IRCD_MIN(fdmax, 65536); return -1; } void fdlist_init(void) { set_fdlimit(); } static inline unsigned int hash_fd(int fd) { return (((unsigned) fd) % FD_HASH_SIZE); } fde_t * lookup_fd(int fd) { fde_t *F = fd_hash[hash_fd(fd)]; while (F) { if (F->fd == fd) return (F); F = F->hnext; } return (NULL); } /* Called to open a given filedescriptor */ void fd_open(fde_t *F, int fd, int is_socket, const char *desc) { unsigned int hashv = hash_fd(fd); assert(fd >= 0); F->fd = fd; F->comm_index = -1; if (desc) strlcpy(F->desc, desc, sizeof(F->desc)); /* Note: normally we'd have to clear the other flags, * but currently F is always cleared before calling us.. */ F->flags.open = 1; F->flags.is_socket = is_socket; F->hnext = fd_hash[hashv]; fd_hash[hashv] = F; number_fd++; } /* Called to close a given filedescriptor */ void fd_close(fde_t *F) { unsigned int hashv = hash_fd(F->fd); if (F == fd_next_in_loop) fd_next_in_loop = F->hnext; if (F->flags.is_socket) comm_setselect(F, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0); delete_resolver_queries(F); #ifdef HAVE_LIBCRYPTO if (F->ssl) SSL_free(F->ssl); #endif if (fd_hash[hashv] == F) fd_hash[hashv] = F->hnext; else { fde_t *prev; /* let it core if not found */ for (prev = fd_hash[hashv]; prev->hnext != F; prev = prev->hnext) ; prev->hnext = F->hnext; } /* Unlike squid, we're actually closing the FD here! -- adrian */ close(F->fd); number_fd--; memset(F, 0, sizeof(fde_t)); } /* * fd_dump() - dump the list of active filedescriptors */ void fd_dump(struct Client *source_p) { int i; fde_t *F; for (i = 0; i < FD_HASH_SIZE; i++) for (F = fd_hash[i]; F != NULL; F = F->hnext) sendto_one(source_p, ":%s %d %s :fd %-5d desc '%s'", me.name, RPL_STATSDEBUG, source_p->name, F->fd, F->desc); } /* * fd_note() - set the fd note * * Note: must be careful not to overflow fd_table[fd].desc when * calling. */ void fd_note(fde_t *F, const char *format, ...) { va_list args; if (format != NULL) { va_start(args, format); vsnprintf(F->desc, sizeof(F->desc), format, args); va_end(args); } else F->desc[0] = '\0'; } /* Make sure stdio descriptors (0-2) and profiler descriptor (3) * always go somewhere harmless. Use -foreground for profiling * or executing from gdb */ void close_standard_fds(void) { int i; for (i = 0; i < LOWEST_SAFE_FD; i++) { close(i); if (open("/dev/null", O_RDWR) < 0) exit(-1); /* we're hosed if we can't even open /dev/null */ } } void close_fds(fde_t *one) { int i; fde_t *F; for (i = 0; i < FD_HASH_SIZE; i++) for (F = fd_hash[i]; F != NULL; F = F->hnext) if (F != one) close(F->fd); } ircd-hybrid-8.1.13.dfsg.1/src/memory.c0000644000175000017500000000421412263053413015450 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * memory.c: Memory utilities. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: memory.c 1664 2012-11-18 14:33:47Z michael $ */ #include "stdinc.h" #include "ircd_defs.h" #include "irc_string.h" #include "memory.h" #include "log.h" #include "restart.h" /* * MyMalloc - allocate memory, call outofmemory on failure */ void * MyMalloc(size_t size) { void *ret = calloc(1, size); if (ret == NULL) outofmemory(); return ret; } /* * MyRealloc - reallocate memory, call outofmemory on failure */ void * MyRealloc(void *x, size_t y) { void *ret = realloc(x, y); if (ret == NULL) outofmemory(); return ret; } void MyFree(void *x) { if (x) free(x); } void * xstrdup(const char *s) { void *ret = malloc(strlen(s) + 1); if (ret == NULL) outofmemory(); strcpy(ret, s); return ret; } void * xstrndup(const char *s, size_t len) { void *ret = malloc(len + 1); if (ret == NULL) outofmemory(); strlcpy(ret, s, len + 1); return ret; } /* outofmemory() * * input - NONE * output - NONE * side effects - simply try to report there is a problem. * Abort if it was called more than once */ void outofmemory(void) { static int was_here = 0; if (was_here++) abort(); ilog(LOG_TYPE_IRCD, "Out of memory: restarting server..."); restart("Out of Memory"); } ircd-hybrid-8.1.13.dfsg.1/src/irc_string.c0000644000175000017500000001354612263053413016313 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * irc_string.c: IRC string functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: irc_string.c 1920 2013-04-30 14:51:30Z michael $ */ #include "config.h" #include "stdinc.h" #include "irc_string.h" int has_wildcards(const char *s) { char c; while ((c = *s++)) if (IsMWildChar(c)) return 1; return 0; } /* * myctime - This is like standard ctime()-function, but it zaps away * the newline from the end of that string. Also, it takes * the time value as parameter, instead of pointer to it. * Note that it is necessary to copy the string to alternate * buffer (who knows how ctime() implements it, maybe it statically * has newline there and never 'refreshes' it -- zapping that * might break things in other places...) * * * Thu Nov 24 18:22:48 1986 */ const char * myctime(time_t value) { static char buf[32]; char *p; strlcpy(buf, ctime(&value), sizeof(buf)); if ((p = strchr(buf, '\n')) != NULL) *p = '\0'; return buf; } /* * strip_tabs(dst, src, length) * * Copies src to dst, while converting all \t (tabs) into spaces. */ void strip_tabs(char *dest, const char *src, size_t len) { char *d = dest; /* Sanity check; we don't want anything nasty... */ assert(dest != NULL); assert(src != NULL); assert(len > 0); for (; --len && *src; ++src) *d++ = *src == '\t' ? ' ' : *src; *d = '\0'; /* NUL terminate, thanks and goodbye */ } /* * strtoken - walk through a string of tokens, using a set of separators * argv 9/90 * */ #ifndef HAVE_STRTOK_R char * strtoken(char** save, char* str, const char* fs) { char* pos = *save; /* keep last position across calls */ char* tmp; if (str) pos = str; /* new string scan */ while (pos && *pos && strchr(fs, *pos) != NULL) ++pos; /* skip leading separators */ if (!pos || !*pos) return (pos = *save = NULL); /* string contains only sep's */ tmp = pos; /* now, keep position of the token */ while (*pos && strchr(fs, *pos) == NULL) ++pos; /* skip content of the token */ if (*pos) *pos++ = '\0'; /* remove first sep after the token */ else pos = NULL; /* end of string */ *save = pos; return tmp; } #endif /* !HAVE_STRTOK_R */ /* libio_basename() * * input - i.e. "/usr/local/ircd/modules/m_whois.so" * output - i.e. "m_whois.so" * side effects - this will be overwritten on subsequent calls */ const char * libio_basename(const char *path) { const char *s; if ((s = strrchr(path, '/')) == NULL) s = path; else s++; return s; } /* * strlcat and strlcpy were ripped from openssh 2.5.1p2 * They had the following Copyright info: * * * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz, dlen; while (n-- != 0 && *d != '\0') d++; dlen = d - dst; n = siz - dlen; if (n == 0) return dlen + strlen(s); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return dlen + (s - src); /* count does not include NUL */ } #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return s - src - 1; /* count does not include NUL */ } #endif ircd-hybrid-8.1.13.dfsg.1/src/numeric.c0000644000175000017500000006445312263053413015615 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * numeric.c: Numeric handling functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: numeric.c 2726 2013-12-29 13:27:10Z michael $ */ #include "stdinc.h" #include "numeric.h" static const char *const replies[] = { /* 000 */ NULL, /* 001 RPL_WELCOME */ ":%s 001 %s :Welcome to the %s Internet Relay Chat Network %s", /* 002 RPL_YOURHOST */ ":%s 002 %s :Your host is %s, running version %s", /* 003 RPL_CREATED */ ":%s 003 %s :This server was created %s", #ifdef HALFOPS /* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s bciklmnoprstveIMORS bkloveIh", #else /* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s bciklmnoprstveIMORS bkloveI", #endif /* 005 RPL_ISUPPORT */ ":%s 005 %s %s :are supported by this server", /* 006 */ NULL, /* 007 */ NULL, /* 008 */ NULL, /* 009 */ NULL, /* 010 RPL_REDIR */ ":%s 010 %s %s %u :Please use this Server/Port instead", /* 011 */ NULL, /* 012 */ NULL, /* 013 */ NULL, /* 014 */ NULL, /* 015 RPL_MAP */ ":%s 015 %s :%s%s%s [%u clients] (%u%%)", /* 016 RPL_MAPMORE */ ":%s 016 %s :%s%s --> *more*", /* 017 RPL_MAPEND */ ":%s 017 %s :End of /MAP", /* 018 */ NULL, /* 019 */ NULL, /* 020 */ NULL, /* 021 */ NULL, /* 022 */ NULL, /* 023 */ NULL, /* 024 */ NULL, /* 025 */ NULL, /* 026 */ NULL, /* 027 */ NULL, /* 028 */ NULL, /* 029 */ NULL, /* 030 */ NULL, /* 031 */ NULL, /* 032 */ NULL, /* 033 */ NULL, /* 034 */ NULL, /* 035 */ NULL, /* 036 */ NULL, /* 037 */ NULL, /* 038 */ NULL, /* 039 */ NULL, /* 040 */ NULL, /* 041 */ NULL, /* 042 RPL_YOURID */ ":%s 042 %s %s :your unique ID", /* 043 */ NULL, /* 044 */ NULL, /* 045 */ NULL, /* 046 */ NULL, /* 047 */ NULL, /* 048 */ NULL, /* 049 */ NULL, /* 050 */ NULL, /* 051 */ NULL, /* 052 */ NULL, /* 053 */ NULL, /* 054 */ NULL, /* 055 */ NULL, /* 056 */ NULL, /* 057 */ NULL, /* 058 */ NULL, /* 059 */ NULL, /* 060 */ NULL, /* 061 */ NULL, /* 062 */ NULL, /* 063 */ NULL, /* 064 */ NULL, /* 065 */ NULL, /* 066 */ NULL, /* 067 */ NULL, /* 068 */ NULL, /* 069 */ NULL, /* 070 */ NULL, /* 071 */ NULL, /* 072 */ NULL, /* 073 */ NULL, /* 074 */ NULL, /* 075 */ NULL, /* 076 */ NULL, /* 077 */ NULL, /* 078 */ NULL, /* 079 */ NULL, /* 080 */ NULL, /* 081 */ NULL, /* 082 */ NULL, /* 083 */ NULL, /* 084 */ NULL, /* 085 */ NULL, /* 086 */ NULL, /* 087 */ NULL, /* 088 */ NULL, /* 089 */ NULL, /* 090 */ NULL, /* 091 */ NULL, /* 092 */ NULL, /* 093 */ NULL, /* 094 */ NULL, /* 095 */ NULL, /* 096 */ NULL, /* 097 */ NULL, /* 098 */ NULL, /* 099 */ NULL, /* 100 */ NULL, /* 101 */ NULL, /* 102 */ NULL, /* 103 */ NULL, /* 104 */ NULL, /* 105 */ NULL, /* 106 */ NULL, /* 107 */ NULL, /* 108 */ NULL, /* 109 */ NULL, /* 110 */ NULL, /* 111 */ NULL, /* 112 */ NULL, /* 113 */ NULL, /* 114 */ NULL, /* 115 */ NULL, /* 116 */ NULL, /* 117 */ NULL, /* 118 */ NULL, /* 119 */ NULL, /* 120 */ NULL, /* 121 */ NULL, /* 122 */ NULL, /* 123 */ NULL, /* 124 */ NULL, /* 125 */ NULL, /* 126 */ NULL, /* 127 */ NULL, /* 128 */ NULL, /* 129 */ NULL, /* 130 */ NULL, /* 131 */ NULL, /* 132 */ NULL, /* 133 */ NULL, /* 134 */ NULL, /* 135 */ NULL, /* 136 */ NULL, /* 137 */ NULL, /* 138 */ NULL, /* 139 */ NULL, /* 140 */ NULL, /* 141 */ NULL, /* 142 */ NULL, /* 143 */ NULL, /* 144 */ NULL, /* 145 */ NULL, /* 146 */ NULL, /* 147 */ NULL, /* 148 */ NULL, /* 149 */ NULL, /* 150 */ NULL, /* 151 */ NULL, /* 152 */ NULL, /* 153 */ NULL, /* 154 */ NULL, /* 155 */ NULL, /* 156 */ NULL, /* 157 */ NULL, /* 158 */ NULL, /* 159 */ NULL, /* 160 */ NULL, /* 161 */ NULL, /* 162 */ NULL, /* 163 */ NULL, /* 164 */ NULL, /* 165 */ NULL, /* 166 */ NULL, /* 167 */ NULL, /* 168 */ NULL, /* 169 */ NULL, /* 170 */ NULL, /* 171 */ NULL, /* 172 */ NULL, /* 173 */ NULL, /* 174 */ NULL, /* 175 */ NULL, /* 176 */ NULL, /* 177 */ NULL, /* 178 */ NULL, /* 179 */ NULL, /* 180 */ NULL, /* 181 */ NULL, /* 182 */ NULL, /* 183 */ NULL, /* 184 */ NULL, /* 185 */ NULL, /* 186 */ NULL, /* 187 */ NULL, /* 188 */ NULL, /* 189 */ NULL, /* 190 */ NULL, /* 191 */ NULL, /* 192 */ NULL, /* 193 */ NULL, /* 194 */ NULL, /* 195 */ NULL, /* 196 */ NULL, /* 197 */ NULL, /* 198 */ NULL, /* 199 */ NULL, /* 200 RPL_TRACELINK */ ":%s 200 %s Link %s %s %s", /* 201 RPL_TRACECONNECTING */ ":%s 201 %s Try. %s %s", /* 202 RPL_TRACEHANDSHAKE */ ":%s 202 %s H.S. %s %s", /* 203 RPL_TRACEUNKNOWN */ ":%s 203 %s ???? %s %s (%s) %d", /* 204 RPL_TRACEOPERATOR */ ":%s 204 %s Oper %s %s (%s) %lu %u", /* 205 RPL_TRACEUSER */ ":%s 205 %s User %s %s (%s) %lu %u", /* 206 RPL_TRACESERVER */ ":%s 206 %s Serv %s %uS %uC %s %s!%s@%s %lu", /* 207 */ NULL, /* 208 RPL_TRACENEWTYPE */ ":%s 208 %s 0 %s", /* 209 RPL_TRACECLASS */ ":%s 209 %s Class %s %d", /* 210 */ NULL, /* 211 RPL_STATSLINKINFO */ ":%s 211 %s %s %u %u %llu %u %llu :%u %u %s", /* 212 RPL_STATSCOMMANDS */ ":%s 212 %s %s %u %llu :%u", /* 213 RPL_STATSCLINE */ ":%s 213 %s %c %s %s %s %d %s", /* 214 RPL_STATSNLINE */ ":%s 214 %s %c %s * %s %d %s", /* 215 RPL_STATSILINE */ ":%s 215 %s %c %s * %s@%s %d %s", /* 216 RPL_STATSKLINE */ ":%s 216 %s %c %s * %s :%s", /* 217 RPL_STATSQLINE */ ":%s 217 %s %c %u %s :%s", /* 218 RPL_STATSYLINE */ ":%s 218 %s %c %s %u %u %u %u %u %u %u/%u %u/%u %s", /* 219 RPL_ENDOFSTATS */ ":%s 219 %s %c :End of /STATS report", /* 220 RPL_STATSPLINE */ ":%s 220 %s %c %d %s %d %s :%s", /* 221 RPL_UMODEIS */ ":%s 221 %s %s", /* 222 */ NULL, /* 223 */ NULL, /* 224 */ NULL, /* 225 RPL_STATSDLINE */ ":%s 225 %s %c %s :%s", /* 226 RPL_STATSALINE */ ":%s 226 %s %s", /* 227 */ NULL, /* 228 */ NULL, /* 229 */ NULL, /* 230 */ NULL, /* 231 */ NULL, /* 232 */ NULL, /* 233 */ NULL, /* 234 */ NULL, /* 235 */ NULL, /* 236 */ NULL, /* 237 */ NULL, /* 238 */ NULL, /* 239 */ NULL, /* 240 */ NULL, /* 241 RPL_STATSLLINE */ ":%s 241 %s %c %s * %s %d %s", /* 242 RPL_STATSUPTIME */ ":%s 242 %s :Server Up %d days, %d:%02d:%02d", /* 243 RPL_STATSOLINE */ ":%s 243 %s %c %u %s@%s * %s %s %s", /* 244 RPL_STATSHLINE */ ":%s 244 %s %c %s * %s %d %s", /* 245 RPL_STATSTLINE */ ":%s 245 %s T %s %s", /* 246 RPL_STATSSERVICE */ ":%s 246 %s %c %s * %s %d %d", /* 247 RPL_STATSXLINE */ ":%s 247 %s %c %d %s :%s", /* 248 RPL_STATSULINE */ ":%s 248 %s U %s %s@%s %s", /* 249 */ NULL, /* 250 RPL_STATSCONN */ ":%s 250 %s :Highest connection count: %d (%d clients) (%llu connections received)", /* 251 RPL_LUSERCLIENT */ ":%s 251 %s :There are %d users and %d invisible on %d servers", /* 252 RPL_LUSEROP */ ":%s 252 %s %d :IRC Operators online", /* 253 RPL_LUSERUNKNOWN */ ":%s 253 %s %d :unknown connection(s)", /* 254 RPL_LUSERCHANNELS */ ":%s 254 %s %d :channels formed", /* 255 RPL_LUSERME */ ":%s 255 %s :I have %d clients and %d servers", /* 256 RPL_ADMINME */ ":%s 256 %s :Administrative info about %s", /* 257 RPL_ADMINLOC1 */ ":%s 257 %s :%s", /* 258 RPL_ADMINLOC2 */ ":%s 258 %s :%s", /* 259 RPL_ADMINEMAIL */ ":%s 259 %s :%s", /* 260 */ NULL, /* 261 */ NULL, /* 262 RPL_ENDOFTRACE */ ":%s 262 %s %s :End of TRACE", /* 263 RPL_LOAD2HI */ ":%s 263 %s :Server load is temporarily too heavy. Please wait a while and try again.", /* 264 */ NULL, /* 265 RPL_LOCALUSERS */ ":%s 265 %s :Current local users: %d Max: %d", /* 266 RPL_GLOBALUSERS */ ":%s 266 %s :Current global users: %d Max: %d", /* 267 */ NULL, /* 268 */ NULL, /* 269 */ NULL, /* 270 */ NULL, /* 271 */ NULL, /* 272 */ NULL, /* 273 */ NULL, /* 274 */ NULL, /* 275 */ NULL, /* 276 RPL_WHOISCERTFP */ ":%s 276 %s %s :has client certificate fingerprint %s", /* 277 */ NULL, /* 278 */ NULL, /* 279 */ NULL, /* 280 */ NULL, /* 281 RPL_ACCEPTLIST */ ":%s 281 %s :%s", /* 282 RPL_ENDOFACCEPT */ ":%s 282 %s :End of /ACCEPT list.", /* 283 */ NULL, /* 284 */ NULL, /* 285 RPL_NEWHOSTIS */ ":%s 285 %s :Your new host is %s", /* 286 */ NULL, /* 287 */ NULL, /* 288 */ NULL, /* 289 */ NULL, /* 290 */ NULL, /* 291 */ NULL, /* 292 */ NULL, /* 293 */ NULL, /* 294 */ NULL, /* 295 */ NULL, /* 296 */ NULL, /* 297 */ NULL, /* 298 */ NULL, /* 299 */ NULL, /* 300 */ NULL, /* 301 RPL_AWAY */ ":%s 301 %s %s :%s", /* 302 RPL_USERHOST */ ":%s 302 %s :%s", /* 303 RPL_ISON */ ":%s 303 %s :", /* 304 */ NULL, /* 305 RPL_UNAWAY */ ":%s 305 %s :You are no longer marked as being away", /* 306 RPL_NOWAWAY */ ":%s 306 %s :You have been marked as being away", /* 307 RPL_WHOISREGNICK */ ":%s 307 %s %s :has identified for this nick", /* 308 */ NULL, /* 309 */ NULL, /* 310 */ NULL, /* 311 RPL_WHOISUSER */ ":%s 311 %s %s %s %s * :%s", /* 312 RPL_WHOISSERVER */ ":%s 312 %s %s %s :%s", /* 313 RPL_WHOISOPERATOR */ ":%s 313 %s %s :%s", /* 314 RPL_WHOWASUSER */ ":%s 314 %s %s %s %s * :%s", /* 315 RPL_ENDOFWHO */ ":%s 315 %s %s :End of /WHO list.", /* 316 */ NULL, /* 317 RPL_WHOISIDLE */ ":%s 317 %s %s %u %d :seconds idle, signon time", /* 318 RPL_ENDOFWHOIS */ ":%s 318 %s %s :End of /WHOIS list.", /* 319 RPL_WHOISCHANNELS */ ":%s 319 %s %s :%s", /* 320 */ NULL, /* 321 RPL_LISTSTART */ ":%s 321 %s Channel :Users Name", /* 322 RPL_LIST */ ":%s 322 %s %s %d :%s%s", /* 323 RPL_LISTEND */ ":%s 323 %s :End of /LIST", /* 324 RPL_CHANNELMODEIS */ ":%s 324 %s %s %s %s", /* 325 */ NULL, /* 326 */ NULL, /* 327 */ NULL, /* 328 */ NULL, /* 329 RPL_CREATIONTIME */ ":%s 329 %s %s %lu", /* 330 RPL_WHOISACCOUNT */ ":%s 330 %s %s %s :is logged in as", /* 331 RPL_NOTOPIC */ ":%s 331 %s %s :No topic is set.", /* 332 RPL_TOPIC */ ":%s 332 %s %s :%s", /* 333 RPL_TOPICWHOTIME */ ":%s 333 %s %s %s %lu", /* 334 */ NULL, /* 335 */ NULL, /* 336 */ NULL, /* 337 RPL_WHOISTEXT */ ":%s 337 %s %s :%s", /* 338 RPL_WHOISACTUALLY */ ":%s 338 %s %s %s :actually using host", /* 339 */ NULL, /* 340 */ NULL, /* 341 RPL_INVITING */ ":%s 341 %s %s %s", /* 342 */ NULL, /* 343 */ NULL, /* 344 */ NULL, /* 345 */ NULL, /* 346 RPL_INVEXLIST */ ":%s 346 %s %s %s!%s@%s %s %lu", /* 347 RPL_ENDOFINVEXLIST */ ":%s 347 %s %s :End of Channel Invite List", /* 348 RPL_EXCEPTLIST */ ":%s 348 %s %s %s!%s@%s %s %lu", /* 349 RPL_ENDOFEXCEPTLIST */ ":%s 349 %s %s :End of Channel Exception List", /* 350 */ NULL, /* 351 RPL_VERSION */ ":%s 351 %s %s(%s). %s :%s", /* 352 RPL_WHOREPLY */ ":%s 352 %s %s %s %s %s %s %s :%d %s", /* 353 RPL_NAMREPLY */ ":%s 353 %s %s %s :", /* 354 */ NULL, /* 355 */ NULL, /* 356 */ NULL, /* 357 */ NULL, /* 358 */ NULL, /* 359 */ NULL, /* 360 */ NULL, /* 361 */ NULL, /* 362 RPL_CLOSING */ ":%s 362 %s %s :Closed. Status = %d", /* 363 RPL_CLOSEEND */ ":%s 363 %s %d: Connections Closed", /* 364 RPL_LINKS */ ":%s 364 %s %s %s :%d %s", /* 365 RPL_ENDOFLINKS */ ":%s 365 %s %s :End of /LINKS list.", /* 366 RPL_ENDOFNAMES */ ":%s 366 %s %s :End of /NAMES list.", /* 367 RPL_BANLIST */ ":%s 367 %s %s %s!%s@%s %s %lu", /* 368 RPL_ENDOFBANLIST */ ":%s 368 %s %s :End of Channel Ban List", /* 369 RPL_ENDOFWHOWAS */ ":%s 369 %s %s :End of WHOWAS", /* 370 */ NULL, /* 371 RPL_INFO */ ":%s 371 %s :%s", /* 372 RPL_MOTD */ ":%s 372 %s :- %s", /* 373 RPL_INFOSTART */ ":%s 373 %s :Server INFO", /* 374 RPL_ENDOFINFO */ ":%s 374 %s :End of /INFO list.", /* 375 RPL_MOTDSTART */ ":%s 375 %s :- %s Message of the Day - ", /* 376 RPL_ENDOFMOTD */ ":%s 376 %s :End of /MOTD command.", /* 377 */ NULL, /* 378 */ NULL, /* 379 RPL_WHOISMODES */ ":%s 379 %s %s :is using modes %s", /* 380 */ NULL, /* 381 RPL_YOUREOPER */ ":%s 381 %s :You have entered... the Twilight Zone!", /* 382 RPL_REHASHING */ ":%s 382 %s %s :Rehashing", /* 383 */ NULL, /* 384 */ NULL, /* 385 */ NULL, /* 386 RPL_RSACHALLENGE */ ":%s 386 %s :%s", /* 387 */ NULL, /* 388 */ NULL, /* 389 */ NULL, /* 390 */ NULL, /* 391 RPL_TIME */ ":%s 391 %s %s :%s", /* 392 */ NULL, /* 393 */ NULL, /* 394 */ NULL, /* 395 */ NULL, /* 396 */ NULL, /* 397 */ NULL, /* 398 */ NULL, /* 399 */ NULL, /* 400 */ NULL, /* 401 ERR_NOSUCHNICK */ ":%s 401 %s %s :No such nick/channel", /* 402 ERR_NOSUCHSERVER */ ":%s 402 %s %s :No such server", /* 403 ERR_NOSUCHCHANNEL */ ":%s 403 %s %s :No such channel", /* 404 ERR_CANNOTSENDTOCHAN */ ":%s 404 %s %s :Cannot send to channel", /* 405 ERR_TOOMANYCHANNELS */ ":%s 405 %s %s :You have joined too many channels", /* 406 ERR_WASNOSUCHNICK */ ":%s 406 %s %s :There was no such nickname", /* 407 ERR_TOOMANYTARGETS */ ":%s 407 %s %s :Too many recipients. Only %d processed", /* 408 ERR_NOCTRLSONCHAN*/ ":%s 408 %s %s :You cannot use control codes on this channel. Not sent: %s", /* 409 ERR_NOORIGIN */ ":%s 409 %s :No origin specified", /* 410 ERR_INVALIDCAPCMD */ ":%s 410 %s %s :Invalid CAP subcommand", /* 411 ERR_NORECIPIENT */ ":%s 411 %s :No recipient given (%s)", /* 412 ERR_NOTEXTTOSEND */ ":%s 412 %s :No text to send", /* 413 ERR_NOTOPLEVEL */ ":%s 413 %s %s :No toplevel domain specified", /* 414 ERR_WILDTOPLEVEL */ ":%s 414 %s %s :Wildcard in toplevel Domain", /* 415 */ NULL, /* 416 */ NULL, /* 417 */ NULL, /* 418 */ NULL, /* 419 */ NULL, /* 420 */ NULL, /* 421 ERR_UNKNOWNCOMMAND */ ":%s 421 %s %s :Unknown command", /* 422 ERR_NOMOTD */ ":%s 422 %s :MOTD File is missing", /* 423 ERR_NOADMININFO */ ":%s 423 %s %s :No administrative info available", /* 424 */ NULL, /* 425 */ NULL, /* 426 */ NULL, /* 427 */ NULL, /* 428 */ NULL, /* 429 */ NULL, /* 430 */ NULL, /* 431 ERR_NONICKNAMEGIVEN */ ":%s 431 %s :No nickname given", /* 432 ERR_ERRONEUSNICKNAME */ ":%s 432 %s %s :%s", /* 433 ERR_NICKNAMEINUSE */ ":%s 433 %s %s :Nickname is already in use.", /* 434 */ NULL, /* 435 */ NULL, /* 436 ERR_NICKCOLLISION */ ":%s 436 %s %s :Nickname collision KILL", /* 437 ERR_UNAVAILRESOURCE */ ":%s 437 %s %s :Nick/channel is temporarily unavailable", /* 438 ERR_NICKTOOFAST */ ":%s 438 %s %s %s :Nick change too fast. Please wait %d seconds.", /* 439 */ NULL, /* 440 ERR_SERVICESDOWN */ ":%s 440 %s %s :Services is currently down.", /* 441 ERR_USERNOTINCHANNEL */ ":%s 441 %s %s %s :They aren't on that channel", /* 442 ERR_NOTONCHANNEL */ ":%s 442 %s %s :You're not on that channel", /* 443 ERR_USERONCHANNEL */ ":%s 443 %s %s %s :is already on channel", /* 444 */ NULL, /* 445 */ NULL, /* 446 */ NULL, /* 447 */ NULL, /* 448 */ NULL, /* 449 */ NULL, /* 450 */ NULL, /* 451 ERR_NOTREGISTERED */ ":%s 451 %s :You have not registered", /* 452 */ NULL, /* 453 */ NULL, /* 454 */ NULL, /* 455 */ NULL, /* 456 ERR_ACCEPTFULL */ ":%s 456 %s :Accept list is full", /* 457 ERR_ACCEPTEXIST */ ":%s 457 %s %s!%s@%s :is already on your accept list", /* 458 ERR_ACCEPTNOT */ ":%s 458 %s %s!%s@%s :is not on your accept list", /* 459 */ NULL, /* 460 */ NULL, /* 461 ERR_NEEDMOREPARAMS */ ":%s 461 %s %s :Not enough parameters", /* 462 ERR_ALREADYREGISTRED */ ":%s 462 %s :You may not reregister", /* 463 */ NULL, /* 464 ERR_PASSWDMISMATCH */ ":%s 464 %s :Password Incorrect", /* 465 ERR_YOUREBANNEDCREEP */ ":%s 465 %s :You are banned from this server- %s", /* 466 */ NULL, /* 467 */ NULL, /* 468 ERR_ONLYSERVERSCANCHANGE */ ":%s 468 %s %s :Only servers can change that mode", /* 469 */ NULL, /* 470 ERR_OPERONLYCHAN */ ":%s 470 %s %s :Cannot join channel (+O)", /* 471 ERR_CHANNELISFULL */ ":%s 471 %s %s :Cannot join channel (+l)", /* 472 ERR_UNKNOWNMODE */ ":%s 472 %s %c :is unknown mode char to me", /* 473 ERR_INVITEONLYCHAN */ ":%s 473 %s %s :Cannot join channel (+i)", /* 474 ERR_BANNEDFROMCHAN */ ":%s 474 %s %s :Cannot join channel (+b)", /* 475 ERR_BADCHANNELKEY */ ":%s 475 %s %s :Cannot join channel (+k)", /* 476 */ NULL, /* 477 ERR_NEEDREGGEDNICK */ ":%s 477 %s %s :You need to identify to a registered nick to join or speak in that channel.", /* 478 ERR_BANLISTFULL */ ":%s 478 %s %s %s :Channel ban list is full", /* 479 ERR_BADCHANNAME */ ":%s 479 %s %s :Illegal channel name", /* 480 ERR_SSLONLYCHAN */ ":%s 480 %s %s :Cannot join channel (+S)", /* 481 ERR_NOPRIVILEGES */ ":%s 481 %s :Permission Denied - You're not an IRC operator", /* 482 ERR_CHANOPRIVSNEEDED */ ":%s 482 %s %s :You're not channel operator", /* 483 ERR_CANTKILLSERVER */ ":%s 483 %s :You can't kill a server!", /* 484 ERR_RESTRICTED */ ":%s 484 %s :You are restricted", /* 485 ERR_CHANBANREASON */ ":%s 485 %s %s :Cannot join channel (%s)", /* 486 ERR_NONONREG */ ":%s 486 %s %s :You must identify to a registered nick to private message that person", /* 487 */ NULL, /* 488 */ NULL, /* 489 */ NULL, /* 490 */ NULL, /* 491 ERR_NOOPERHOST */ ":%s 491 %s :Only few of mere mortals may try to enter the twilight zone", /* 492 */ NULL, /* 493 */ NULL, /* 494 */ NULL, /* 495 */ NULL, /* 496 */ NULL, /* 497 */ NULL, /* 498 */ NULL, /* 499 */ NULL, /* 500 */ NULL, /* 501 ERR_UMODEUNKNOWNFLAG */ ":%s 501 %s :Unknown MODE flag", /* 502 ERR_USERSDONTMATCH */ ":%s 502 %s :Can't change mode for other users", /* 503 ERR_GHOSTEDCLIENT */ ":%s 503 %s :Message could not be delivered to %s", /* 504 ERR_USERNOTONSERV */ ":%s 504 %s %s :User is not on this server", /* 505 */ NULL, /* 506 */ NULL, /* 507 */ NULL, /* 508 */ NULL, /* 509 */ NULL, /* 510 */ NULL, /* 511 */ NULL, /* 512 ERR_TOOMANYWATCH */ ":%s 512 %s %s :Maximum size for WATCH-list is %d entries", /* 513 ERR_WRONGPONG */ ":%s 513 %s :To connect type /QUOTE PONG %u", /* 514 */ NULL, /* 515 */ NULL, /* 516 */ NULL, /* 517 */ NULL, /* 518 */ NULL, /* 519 */ NULL, /* 520 */ NULL, /* 521 ERR_LISTSYNTAX */ ":%s 521 %s :Bad list syntax, type /QUOTE HELP LIST", /* 522 */ NULL, /* 523 */ NULL, /* 524 ERR_HELPNOTFOUND */ ":%s 524 %s %s :Help not found", /* 525 */ NULL, /* 526 */ NULL, /* 527 */ NULL, /* 528 */ NULL, /* 529 */ NULL, /* 530 */ NULL, /* 531 */ NULL, /* 532 */ NULL, /* 533 */ NULL, /* 534 */ NULL, /* 535 */ NULL, /* 536 */ NULL, /* 537 */ NULL, /* 538 */ NULL, /* 539 */ NULL, /* 540 */ NULL, /* 541 */ NULL, /* 542 */ NULL, /* 543 */ NULL, /* 544 */ NULL, /* 545 */ NULL, /* 546 */ NULL, /* 547 */ NULL, /* 548 */ NULL, /* 549 */ NULL, /* 550 */ NULL, /* 551 */ NULL, /* 552 */ NULL, /* 553 */ NULL, /* 554 */ NULL, /* 555 */ NULL, /* 556 */ NULL, /* 557 */ NULL, /* 558 */ NULL, /* 559 */ NULL, /* 560 */ NULL, /* 561 */ NULL, /* 562 */ NULL, /* 563 */ NULL, /* 564 */ NULL, /* 565 */ NULL, /* 566 */ NULL, /* 567 */ NULL, /* 568 */ NULL, /* 569 */ NULL, /* 570 */ NULL, /* 571 */ NULL, /* 572 */ NULL, /* 573 */ NULL, /* 574 */ NULL, /* 575 */ NULL, /* 576 */ NULL, /* 577 */ NULL, /* 578 */ NULL, /* 579 */ NULL, /* 580 */ NULL, /* 581 */ NULL, /* 582 */ NULL, /* 583 */ NULL, /* 584 */ NULL, /* 585 */ NULL, /* 586 */ NULL, /* 587 */ NULL, /* 588 */ NULL, /* 589 */ NULL, /* 590 */ NULL, /* 591 */ NULL, /* 592 */ NULL, /* 593 */ NULL, /* 594 */ NULL, /* 595 */ NULL, /* 596 */ NULL, /* 597 */ NULL, /* 598 */ NULL, /* 599 */ NULL, /* 600 RPL_LOGON */ ":%s 600 %s %s %s %s %d :logged online", /* 601 RPL_LOGOFF */ ":%s 601 %s %s %s %s %d :logged offline", /* 602 RPL_WATCHOFF */ ":%s 602 %s %s %s %s %d :stopped watching", /* 603 RPL_WATCHSTAT */ ":%s 603 %s :You have %u and are on %u WATCH entries", /* 604 RPL_NOWON */ ":%s 604 %s %s %s %s %d :is online", /* 605 RPL_NOWOFF */ ":%s 605 %s %s %s %s %d :is offline", /* 606 RPL_WATCHLIST */ ":%s 606 %s :%s", /* 607 RPL_ENDOFWATCHLIST */ ":%s 607 %s :End of WATCH %c", /* 608 */ NULL, /* 609 */ NULL, /* 610 */ NULL, /* 611 */ NULL, /* 612 */ NULL, /* 613 */ NULL, /* 614 */ NULL, /* 615 */ NULL, /* 616 */ NULL, /* 617 */ NULL, /* 618 */ NULL, /* 619 */ NULL, /* 620 */ NULL, /* 621 */ NULL, /* 622 */ NULL, /* 623 */ NULL, /* 624 */ NULL, /* 625 */ NULL, /* 626 */ NULL, /* 627 */ NULL, /* 628 */ NULL, /* 629 */ NULL, /* 630 */ NULL, /* 631 */ NULL, /* 632 */ NULL, /* 633 */ NULL, /* 634 */ NULL, /* 635 */ NULL, /* 636 */ NULL, /* 637 */ NULL, /* 638 */ NULL, /* 639 */ NULL, /* 640 */ NULL, /* 641 */ NULL, /* 642 */ NULL, /* 643 */ NULL, /* 644 */ NULL, /* 645 */ NULL, /* 646 */ NULL, /* 647 */ NULL, /* 648 */ NULL, /* 649 */ NULL, /* 650 */ NULL, /* 651 */ NULL, /* 652 */ NULL, /* 653 */ NULL, /* 654 */ NULL, /* 655 */ NULL, /* 656 */ NULL, /* 657 */ NULL, /* 658 */ NULL, /* 659 */ NULL, /* 660 */ NULL, /* 661 */ NULL, /* 662 */ NULL, /* 663 */ NULL, /* 664 */ NULL, /* 665 */ NULL, /* 666 */ NULL, /* 667 */ NULL, /* 668 */ NULL, /* 669 */ NULL, /* 670 */ NULL, /* 671 RPL_WHOISSECURE */ ":%s 671 %s %s :is connected via SSL (secure link)", /* 672 */ NULL, /* 673 */ NULL, /* 674 */ NULL, /* 675 */ NULL, /* 676 */ NULL, /* 677 */ NULL, /* 678 */ NULL, /* 679 */ NULL, /* 680 */ NULL, /* 681 */ NULL, /* 682 */ NULL, /* 683 */ NULL, /* 684 */ NULL, /* 685 */ NULL, /* 686 */ NULL, /* 687 */ NULL, /* 688 */ NULL, /* 689 */ NULL, /* 690 */ NULL, /* 691 */ NULL, /* 692 */ NULL, /* 693 */ NULL, /* 694 */ NULL, /* 695 */ NULL, /* 696 */ NULL, /* 697 */ NULL, /* 698 */ NULL, /* 699 */ NULL, /* 700 */ NULL, /* 701 */ NULL, /* 702 RPL_MODLIST */ ":%s 702 %s %s %p %s %s", /* 703 RPL_ENDOFMODLIST */ ":%s 703 %s :End of /MODLIST.", /* 704 RPL_HELPSTART */ ":%s 704 %s %s :%s", /* 705 RPL_HELPTXT */ ":%s 705 %s %s :%s", /* 706 RPL_ENDOFHELP */ ":%s 706 %s %s :End of /HELP.", /* 707 */ NULL, /* 708 */ NULL, /* 709 RPL_ETRACE */ ":%s 709 %s %s %s %s %s %s %s :%s", /* 710 RPL_KNOCK */ ":%s 710 %s %s %s!%s@%s :has asked for an invite.", /* 711 RPL_KNOCKDLVR */ ":%s 711 %s %s :Your KNOCK has been delivered.", /* 712 ERR_TOOMANYKNOCK */ ":%s 712 %s %s :Too many KNOCKs (%s).", /* 713 ERR_CHANOPEN */ ":%s 713 %s %s :Channel is open.", /* 714 ERR_KNOCKONCHAN */ ":%s 714 %s %s :You are already on that channel.", /* 715 */ NULL, /* 716 RPL_TARGUMODEG */ ":%s 716 %s %s :is in %s mode (%s)", /* 717 RPL_TARGNOTIFY */ ":%s 717 %s %s :has been informed that you messaged them.", /* 718 RPL_UMODEGMSG */ ":%s 718 %s %s :is messaging you, and you are umode %s.", /* 719 */ NULL, /* 720 */ NULL, /* 721 */ NULL, /* 722 */ NULL, /* 723 ERR_NOPRIVS */ ":%s 723 %s %s :Insufficient oper privs.", /* 724 */ NULL, /* 725 */ NULL, /* 726 */ NULL, /* 727 */ NULL, /* 728 */ NULL, /* 729 */ NULL, /* 730 */ NULL, /* 731 */ NULL, /* 732 */ NULL, /* 733 */ NULL, /* 734 */ NULL, /* 735 */ NULL, /* 736 */ NULL, /* 737 */ NULL, /* 738 */ NULL, /* 739 */ NULL, /* 740 */ NULL, /* 741 */ NULL, /* 742 */ NULL, /* 743 */ NULL, /* 744 */ NULL, /* 745 */ NULL, /* 746 */ NULL, /* 747 */ NULL, /* 748 */ NULL, /* 749 */ NULL, /* 750 */ NULL, /* 751 */ NULL, /* 752 */ NULL, /* 753 */ NULL, /* 754 */ NULL, /* 755 */ NULL, /* 756 */ NULL, /* 757 */ NULL, /* 758 */ NULL, /* 759 */ NULL, /* 760 */ NULL, /* 761 */ NULL, /* 762 */ NULL, /* 763 */ NULL, /* 764 */ NULL, /* 765 */ NULL, /* 766 */ NULL, /* 767 */ NULL, /* 768 */ NULL, /* 769 */ NULL, /* 770 */ NULL, /* 771 */ NULL, /* 772 */ NULL, /* 773 */ NULL, /* 774 */ NULL, /* 775 */ NULL, /* 776 */ NULL, /* 777 */ NULL, /* 778 */ NULL, /* 779 */ NULL, /* 780 */ NULL, /* 781 */ NULL, /* 782 */ NULL, /* 783 */ NULL, /* 784 */ NULL, /* 785 */ NULL, /* 786 */ NULL, /* 787 */ NULL, /* 788 */ NULL, /* 789 */ NULL, /* 790 */ NULL, /* 791 */ NULL, /* 792 */ NULL, /* 793 */ NULL, /* 794 */ NULL, /* 795 */ NULL, /* 796 */ NULL, /* 797 */ NULL, /* 798 */ NULL, /* 799 */ NULL, /* 800 */ NULL, /* 801 */ NULL, /* 802 */ NULL, /* 803 */ NULL, /* 804 */ NULL, /* 805 */ NULL, /* 806 */ NULL, /* 807 */ NULL, /* 808 */ NULL, /* 809 */ NULL, /* 810 */ NULL, /* 811 */ NULL, /* 812 */ NULL, /* 813 */ NULL, /* 814 */ NULL, /* 815 */ NULL, /* 816 */ NULL, /* 817 */ NULL, /* 818 */ NULL, /* 819 */ NULL, /* 820 */ NULL, /* 821 */ NULL, /* 822 */ NULL, /* 823 */ NULL, /* 824 */ NULL, /* 825 */ NULL, /* 826 */ NULL, /* 827 */ NULL, /* 828 */ NULL, /* 829 */ NULL, /* 830 */ NULL, /* 831 */ NULL, /* 832 */ NULL, /* 833 */ NULL, /* 834 */ NULL, /* 835 */ NULL, /* 836 */ NULL, /* 837 */ NULL, /* 838 */ NULL, /* 839 */ NULL, /* 840 */ NULL, /* 841 */ NULL, /* 842 */ NULL, /* 843 */ NULL, /* 844 */ NULL, /* 845 */ NULL, /* 846 */ NULL, /* 847 */ NULL, /* 848 */ NULL, /* 849 */ NULL, /* 850 */ NULL, /* 851 */ NULL, /* 852 */ NULL, /* 853 */ NULL, /* 854 */ NULL, /* 855 */ NULL, /* 856 */ NULL, /* 857 */ NULL, /* 858 */ NULL, /* 859 */ NULL, /* 860 */ NULL, /* 861 */ NULL, /* 862 */ NULL, /* 863 */ NULL, /* 864 */ NULL, /* 865 */ NULL, /* 866 */ NULL, /* 867 */ NULL, /* 868 */ NULL, /* 869 */ NULL, /* 870 */ NULL, /* 871 */ NULL, /* 872 */ NULL, /* 873 */ NULL, /* 874 */ NULL, /* 875 */ NULL, /* 876 */ NULL, /* 877 */ NULL, /* 878 */ NULL, /* 879 */ NULL, /* 880 */ NULL, /* 881 */ NULL, /* 882 */ NULL, /* 883 */ NULL, /* 884 */ NULL, /* 885 */ NULL, /* 886 */ NULL, /* 887 */ NULL, /* 888 */ NULL, /* 889 */ NULL, /* 890 */ NULL, /* 891 */ NULL, /* 892 */ NULL, /* 893 */ NULL, /* 894 */ NULL, /* 895 */ NULL, /* 896 */ NULL, /* 897 */ NULL, /* 898 */ NULL, /* 899 */ NULL, /* 900 */ NULL, /* 901 */ NULL, /* 902 */ NULL, /* 903 */ NULL, /* 904 */ NULL, /* 905 */ NULL, /* 906 */ NULL, /* 907 */ NULL, /* 908 */ NULL, /* 909 */ NULL, /* 910 */ NULL, /* 911 */ NULL, /* 912 */ NULL, /* 913 */ NULL, /* 914 */ NULL, /* 915 */ NULL, /* 916 */ NULL, /* 917 */ NULL, /* 918 */ NULL, /* 919 */ NULL, /* 920 */ NULL, /* 921 */ NULL, /* 922 */ NULL, /* 923 */ NULL, /* 924 */ NULL, /* 925 */ NULL, /* 926 */ NULL, /* 927 */ NULL, /* 928 */ NULL, /* 929 */ NULL, /* 930 */ NULL, /* 931 */ NULL, /* 932 */ NULL, /* 933 */ NULL, /* 934 */ NULL, /* 935 */ NULL, /* 936 */ NULL, /* 937 */ NULL, /* 938 */ NULL, /* 939 */ NULL, /* 940 */ NULL, /* 941 */ NULL, /* 942 */ NULL, /* 943 */ NULL, /* 944 */ NULL, /* 945 */ NULL, /* 946 */ NULL, /* 947 */ NULL, /* 948 */ NULL, /* 949 */ NULL, /* 950 */ NULL, /* 951 */ NULL, /* 952 */ NULL, /* 953 */ NULL, /* 954 */ NULL, /* 955 */ NULL, /* 956 */ NULL, /* 957 */ NULL, /* 958 */ NULL, /* 959 */ NULL, /* 960 */ NULL, /* 961 */ NULL, /* 962 */ NULL, /* 963 */ NULL, /* 964 */ NULL, /* 965 */ NULL, /* 966 */ NULL, /* 967 */ NULL, /* 968 */ NULL, /* 969 */ NULL, /* 970 */ NULL, /* 971 */ NULL, /* 972 */ NULL, /* 973 */ NULL, /* 974 */ NULL, /* 975 */ NULL, /* 976 */ NULL, /* 977 */ NULL, /* 978 */ NULL, /* 979 */ NULL, /* 980 */ NULL, /* 981 */ NULL, /* 982 */ NULL, /* 983 */ NULL, /* 984 */ NULL, /* 985 */ NULL, /* 986 */ NULL, /* 987 */ NULL, /* 988 */ NULL, /* 989 */ NULL, /* 990 */ NULL, /* 991 */ NULL, /* 992 */ NULL, /* 993 */ NULL, /* 994 */ NULL, /* 995 */ NULL, /* 996 */ NULL, /* 997 */ NULL, /* 998 */ NULL, /* 999 ERR_LAST_ERR_MSG */ ":%s 999 %s :Last Error Message" }; /* * form_str * * inputs - numeric * output - corresponding string * side effects - NONE */ const char * form_str(unsigned int numeric) { assert(numeric < ERR_LAST_ERR_MSG); if (numeric > ERR_LAST_ERR_MSG) numeric = ERR_LAST_ERR_MSG; assert(replies[numeric]); return replies[numeric]; } ircd-hybrid-8.1.13.dfsg.1/src/irc_res.c0000644000175000017500000005401412263053413015571 0ustar domdom/* * A rewrite of Darren Reeds original res.c As there is nothing * left of Darrens original code, this is now licensed by the hybrid group. * (Well, some of the function names are the same, and bits of the structs..) * You can use it where it is useful, free even. Buy us a beer and stuff. * * The authors takes no responsibility for any damage or loss * of property which results from the use of this software. * * $Id: irc_res.c 1834 2013-04-19 19:50:27Z michael $ * * July 1999 - Rewrote a bunch of stuff here. Change hostent builder code, * added callbacks and reference counting of returned hostents. * --Bleep (Thomas Helvey ) * * This was all needlessly complicated for irc. Simplified. No more hostent * All we really care about is the IP -> hostname mappings. Thats all. * * Apr 28, 2003 --cryogen and Dianora */ #include "stdinc.h" #include "list.h" #include "client.h" #include "event.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "rng_mt.h" #include "fdlist.h" #include "s_bsd.h" #include "log.h" #include "s_misc.h" #include "send.h" #include "memory.h" #include "mempool.h" #include "irc_res.h" #include "irc_reslib.h" #if (CHAR_BIT != 8) #error this code needs to be able to address individual octets #endif static PF res_readreply; #define MAXPACKET 1024 /* rfc sez 512 but we expand names so ... */ #define RES_MAXALIASES 35 /* maximum aliases allowed */ #define RES_MAXADDRS 35 /* maximum addresses allowed */ #define AR_TTL 600 /* TTL in seconds for dns cache entries */ /* RFC 1104/1105 wasn't very helpful about what these fields * should be named, so for now, we'll just name them this way. * we probably should look at what named calls them or something. */ #define TYPE_SIZE (size_t)2 #define CLASS_SIZE (size_t)2 #define TTL_SIZE (size_t)4 #define RDLENGTH_SIZE (size_t)2 #define ANSWER_FIXED_SIZE (TYPE_SIZE + CLASS_SIZE + TTL_SIZE + RDLENGTH_SIZE) typedef enum { REQ_IDLE, /* We're doing not much at all */ REQ_PTR, /* Looking up a PTR */ REQ_A, /* Looking up an A, possibly because AAAA failed */ #ifdef IPV6 REQ_AAAA, /* Looking up an AAAA */ #endif REQ_CNAME /* We got a CNAME in response, we better get a real answer next */ } request_state; struct reslist { dlink_node node; int id; int sent; /* number of requests sent */ request_state state; /* State the resolver machine is in */ time_t ttl; char type; char retries; /* retry counter */ char sends; /* number of sends (>1 means resent) */ char resend; /* send flag. 0 == dont resend */ time_t sentat; time_t timeout; struct irc_ssaddr addr; char *name; dns_callback_fnc callback; void *callback_ctx; }; static fde_t ResolverFileDescriptor; static dlink_list request_list = { NULL, NULL, 0 }; static mp_pool_t *dns_pool = NULL; static void rem_request(struct reslist *); static struct reslist *make_request(dns_callback_fnc, void *); static void do_query_name(dns_callback_fnc, void *, const char *, struct reslist *, int); static void do_query_number(dns_callback_fnc, void *, const struct irc_ssaddr *, struct reslist *); static void query_name(const char *, int, int, struct reslist *); static int send_res_msg(const char *, int, int); static void resend_query(struct reslist *); static int proc_answer(struct reslist *, HEADER *, char *, char *); static struct reslist *find_id(int); /* * int * res_ourserver(inp) * looks up "inp" in irc_nsaddr_list[] * returns: * 0 : not found * >0 : found * author: * paul vixie, 29may94 * revised for ircd, cryogen(stu) may03 */ static int res_ourserver(const struct irc_ssaddr *inp) { #ifdef IPV6 const struct sockaddr_in6 *v6; const struct sockaddr_in6 *v6in = (const struct sockaddr_in6 *)inp; #endif const struct sockaddr_in *v4; const struct sockaddr_in *v4in = (const struct sockaddr_in *)inp; int ns; for (ns = 0; ns < irc_nscount; ++ns) { const struct irc_ssaddr *srv = &irc_nsaddr_list[ns]; #ifdef IPV6 v6 = (const struct sockaddr_in6 *)srv; #endif v4 = (const struct sockaddr_in *)srv; /* could probably just memcmp(srv, inp, srv.ss_len) here * but we'll air on the side of caution - stu * */ switch (srv->ss.ss_family) { #ifdef IPV6 case AF_INET6: if (srv->ss.ss_family == inp->ss.ss_family) if (v6->sin6_port == v6in->sin6_port) if (!memcmp(&v6->sin6_addr.s6_addr, &v6in->sin6_addr.s6_addr, sizeof(struct in6_addr))) return 1; break; #endif case AF_INET: if (srv->ss.ss_family == inp->ss.ss_family) if (v4->sin_port == v4in->sin_port) if (v4->sin_addr.s_addr == v4in->sin_addr.s_addr) return 1; break; default: break; } } return 0; } /* * timeout_query_list - Remove queries from the list which have been * there too long without being resolved. */ static time_t timeout_query_list(time_t now) { dlink_node *ptr; dlink_node *next_ptr; struct reslist *request; time_t next_time = 0; time_t timeout = 0; DLINK_FOREACH_SAFE(ptr, next_ptr, request_list.head) { request = ptr->data; timeout = request->sentat + request->timeout; if (now >= timeout) { if (--request->retries <= 0) { (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); continue; } else { request->sentat = now; request->timeout += request->timeout; resend_query(request); } } if ((next_time == 0) || timeout < next_time) next_time = timeout; } return (next_time > now) ? next_time : (now + AR_TTL); } /* * timeout_resolver - check request list */ static void timeout_resolver(void *notused) { timeout_query_list(CurrentTime); } /* * start_resolver - do everything we need to read the resolv.conf file * and initialize the resolver file descriptor if needed */ static void start_resolver(void) { irc_res_init(); if (!ResolverFileDescriptor.flags.open) { if (comm_open(&ResolverFileDescriptor, irc_nsaddr_list[0].ss.ss_family, SOCK_DGRAM, 0, "Resolver socket") == -1) return; /* At the moment, the resolver FD data is global .. */ comm_setselect(&ResolverFileDescriptor, COMM_SELECT_READ, res_readreply, NULL, 0); eventAdd("timeout_resolver", timeout_resolver, NULL, 1); } } /* * init_resolver - initialize resolver and resolver library */ void init_resolver(void) { dns_pool = mp_pool_new(sizeof(struct reslist), MP_CHUNK_SIZE_DNS); memset(&ResolverFileDescriptor, 0, sizeof(fde_t)); start_resolver(); } /* * restart_resolver - reread resolv.conf, reopen socket */ void restart_resolver(void) { fd_close(&ResolverFileDescriptor); eventDelete(timeout_resolver, NULL); /* -ddosen */ start_resolver(); } /* * rem_request - remove a request from the list. * This must also free any memory that has been allocated for * temporary storage of DNS results. */ static void rem_request(struct reslist *request) { dlinkDelete(&request->node, &request_list); MyFree(request->name); mp_pool_release(request); } /* * make_request - Create a DNS request record for the server. */ static struct reslist * make_request(dns_callback_fnc callback, void *ctx) { struct reslist *request = mp_pool_get(dns_pool); memset(request, 0, sizeof(*request)); request->sentat = CurrentTime; request->retries = 3; request->resend = 1; request->timeout = 4; /* start at 4 and exponential inc. */ request->state = REQ_IDLE; request->callback = callback; request->callback_ctx = ctx; dlinkAdd(request, &request->node, &request_list); return request; } /* * delete_resolver_queries - cleanup outstanding queries * for which there no longer exist clients or conf lines. */ void delete_resolver_queries(const void *vptr) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, request_list.head) { struct reslist *request = ptr->data; if (request->callback_ctx == vptr) rem_request(request); } } /* * send_res_msg - sends msg to all nameservers found in the "_res" structure. * This should reflect /etc/resolv.conf. We will get responses * which arent needed but is easier than checking to see if nameserver * isnt present. Returns number of messages successfully sent to * nameservers or -1 if no successful sends. */ static int send_res_msg(const char *msg, int len, int rcount) { int i; int sent = 0; int max_queries = IRCD_MIN(irc_nscount, rcount); /* RES_PRIMARY option is not implemented * if (res.options & RES_PRIMARY || 0 == max_queries) */ if (max_queries == 0) max_queries = 1; for (i = 0; i < max_queries; i++) { if (sendto(ResolverFileDescriptor.fd, msg, len, 0, (struct sockaddr*)&(irc_nsaddr_list[i]), irc_nsaddr_list[i].ss_len) == len) ++sent; } return sent; } /* * find_id - find a dns request id (id is determined by dn_mkquery) */ static struct reslist * find_id(int id) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, request_list.head) { struct reslist *request = ptr->data; if (request->id == id) return request; } return NULL; } /* * gethost_byname_type - get host address from name * */ void gethost_byname_type(dns_callback_fnc callback, void *ctx, const char *name, int type) { assert(name != NULL); do_query_name(callback, ctx, name, NULL, type); } /* * gethost_byname - wrapper for _type - send T_AAAA first if IPV6 supported */ void gethost_byname(dns_callback_fnc callback, void *ctx, const char *name) { #ifdef IPV6 gethost_byname_type(callback, ctx, name, T_AAAA); #else gethost_byname_type(callback, ctx, name, T_A); #endif } /* * gethost_byaddr - get host name from address */ void gethost_byaddr(dns_callback_fnc callback, void *ctx, const struct irc_ssaddr *addr) { do_query_number(callback, ctx, addr, NULL); } /* * do_query_name - nameserver lookup name */ static void do_query_name(dns_callback_fnc callback, void *ctx, const char *name, struct reslist *request, int type) { char host_name[HOSTLEN + 1]; strlcpy(host_name, name, sizeof(host_name)); if (request == NULL) { request = make_request(callback, ctx); request->name = MyMalloc(strlen(host_name) + 1); request->type = type; strcpy(request->name, host_name); #ifdef IPV6 if (type != T_A) request->state = REQ_AAAA; else #endif request->state = REQ_A; } request->type = type; query_name(host_name, C_IN, type, request); } /* * do_query_number - Use this to do reverse IP# lookups. */ static void do_query_number(dns_callback_fnc callback, void *ctx, const struct irc_ssaddr *addr, struct reslist *request) { char ipbuf[128]; const unsigned char *cp; if (addr->ss.ss_family == AF_INET) { const struct sockaddr_in *v4 = (const struct sockaddr_in *)addr; cp = (const unsigned char *)&v4->sin_addr.s_addr; snprintf(ipbuf, sizeof(ipbuf), "%u.%u.%u.%u.in-addr.arpa.", (unsigned int)(cp[3]), (unsigned int)(cp[2]), (unsigned int)(cp[1]), (unsigned int)(cp[0])); } #ifdef IPV6 else if (addr->ss.ss_family == AF_INET6) { const struct sockaddr_in6 *v6 = (const struct sockaddr_in6 *)addr; cp = (const unsigned char *)&v6->sin6_addr.s6_addr; snprintf(ipbuf, sizeof(ipbuf), "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x." "%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa.", (unsigned int)(cp[15] & 0xf), (unsigned int)(cp[15] >> 4), (unsigned int)(cp[14] & 0xf), (unsigned int)(cp[14] >> 4), (unsigned int)(cp[13] & 0xf), (unsigned int)(cp[13] >> 4), (unsigned int)(cp[12] & 0xf), (unsigned int)(cp[12] >> 4), (unsigned int)(cp[11] & 0xf), (unsigned int)(cp[11] >> 4), (unsigned int)(cp[10] & 0xf), (unsigned int)(cp[10] >> 4), (unsigned int)(cp[9] & 0xf), (unsigned int)(cp[9] >> 4), (unsigned int)(cp[8] & 0xf), (unsigned int)(cp[8] >> 4), (unsigned int)(cp[7] & 0xf), (unsigned int)(cp[7] >> 4), (unsigned int)(cp[6] & 0xf), (unsigned int)(cp[6] >> 4), (unsigned int)(cp[5] & 0xf), (unsigned int)(cp[5] >> 4), (unsigned int)(cp[4] & 0xf), (unsigned int)(cp[4] >> 4), (unsigned int)(cp[3] & 0xf), (unsigned int)(cp[3] >> 4), (unsigned int)(cp[2] & 0xf), (unsigned int)(cp[2] >> 4), (unsigned int)(cp[1] & 0xf), (unsigned int)(cp[1] >> 4), (unsigned int)(cp[0] & 0xf), (unsigned int)(cp[0] >> 4)); } #endif if (request == NULL) { request = make_request(callback, ctx); request->type = T_PTR; memcpy(&request->addr, addr, sizeof(struct irc_ssaddr)); request->name = MyMalloc(HOSTLEN + 1); } query_name(ipbuf, C_IN, T_PTR, request); } /* * query_name - generate a query based on class, type and name. */ static void query_name(const char *name, int query_class, int type, struct reslist *request) { char buf[MAXPACKET]; int request_len = 0; memset(buf, 0, sizeof(buf)); if ((request_len = irc_res_mkquery(name, query_class, type, (unsigned char *)buf, sizeof(buf))) > 0) { HEADER *header = (HEADER *)buf; /* * generate an unique id * NOTE: we don't have to worry about converting this to and from * network byte order, the nameserver does not interpret this value * and returns it unchanged */ do header->id = (header->id + genrand_int32()) & 0xffff; while (find_id(header->id)); request->id = header->id; ++request->sends; request->sent += send_res_msg(buf, request_len, request->sends); } } static void resend_query(struct reslist *request) { if (request->resend == 0) return; switch (request->type) { case T_PTR: do_query_number(NULL, NULL, &request->addr, request); break; case T_A: do_query_name(NULL, NULL, request->name, request, request->type); break; #ifdef IPV6 case T_AAAA: /* didnt work, try A */ if (request->state == REQ_AAAA) do_query_name(NULL, NULL, request->name, request, T_A); #endif default: break; } } /* * proc_answer - process name server reply */ static int proc_answer(struct reslist *request, HEADER *header, char *buf, char *eob) { char hostbuf[HOSTLEN + 100]; /* working buffer */ unsigned char *current; /* current position in buf */ int query_class; /* answer class */ int type; /* answer type */ int n; /* temp count */ int rd_length; struct sockaddr_in *v4; /* conversion */ #ifdef IPV6 struct sockaddr_in6 *v6; #endif current = (unsigned char *)buf + sizeof(HEADER); for (; header->qdcount > 0; --header->qdcount) { if ((n = irc_dn_skipname(current, (unsigned char *)eob)) < 0) break; current += (size_t)n + QFIXEDSZ; } /* * process each answer sent to us blech. */ while (header->ancount > 0 && (char *)current < eob) { header->ancount--; n = irc_dn_expand((unsigned char *)buf, (unsigned char *)eob, current, hostbuf, sizeof(hostbuf)); if (n < 0 /* broken message */ || n == 0 /* no more answers left */) return 0; hostbuf[HOSTLEN] = '\0'; /* With Address arithmetic you have to be very anal * this code was not working on alpha due to that * (spotted by rodder/jailbird/dianora) */ current += (size_t) n; if (!(((char *)current + ANSWER_FIXED_SIZE) < eob)) break; type = irc_ns_get16(current); current += TYPE_SIZE; query_class = irc_ns_get16(current); current += CLASS_SIZE; request->ttl = irc_ns_get32(current); current += TTL_SIZE; rd_length = irc_ns_get16(current); current += RDLENGTH_SIZE; /* * Wait to set request->type until we verify this structure */ switch (type) { case T_A: if (request->type != T_A) return 0; /* * check for invalid rd_length or too many addresses */ if (rd_length != sizeof(struct in_addr)) return 0; v4 = (struct sockaddr_in *)&request->addr; request->addr.ss_len = sizeof(struct sockaddr_in); v4->sin_family = AF_INET; memcpy(&v4->sin_addr, current, sizeof(struct in_addr)); return 1; break; #ifdef IPV6 case T_AAAA: if (request->type != T_AAAA) return 0; if (rd_length != sizeof(struct in6_addr)) return 0; request->addr.ss_len = sizeof(struct sockaddr_in6); v6 = (struct sockaddr_in6 *)&request->addr; v6->sin6_family = AF_INET6; memcpy(&v6->sin6_addr, current, sizeof(struct in6_addr)); return 1; break; #endif case T_PTR: if (request->type != T_PTR) return 0; n = irc_dn_expand((unsigned char *)buf, (unsigned char *)eob, current, hostbuf, sizeof(hostbuf)); if (n < 0 /* broken message */ || n == 0 /* no more answers left */) return 0; strlcpy(request->name, hostbuf, HOSTLEN + 1); return 1; break; case T_CNAME: /* first check we already havent started looking into a cname */ if (request->type != T_PTR) return 0; if (request->state == REQ_CNAME) { n = irc_dn_expand((unsigned char *)buf, (unsigned char *)eob, current, hostbuf, sizeof(hostbuf)); if (n < 0) return 0; return 1; } request->state = REQ_CNAME; current += rd_length; break; default: /* XXX I'd rather just throw away the entire bogus thing * but its possible its just a broken nameserver with still * valid answers. But lets do some rudimentary logging for now... */ ilog(LOG_TYPE_IRCD, "irc_res.c bogus type %d", type); break; } } return 1; } /* * res_readreply - read a dns reply from the nameserver and process it. */ static void res_readreply(fde_t *fd, void *data) { char buf[sizeof(HEADER) + MAXPACKET] /* Sparc and alpha need 16bit-alignment for accessing header->id * (which is uint16_t). Because of the header = (HEADER*) buf; * lateron, this is neeeded. --FaUl */ #if defined(__sparc__) || defined(__alpha__) __attribute__((aligned (16))) #endif ; HEADER *header; struct reslist *request = NULL; int rc; socklen_t len = sizeof(struct irc_ssaddr); struct irc_ssaddr lsin; rc = recvfrom(fd->fd, buf, sizeof(buf), 0, (struct sockaddr *)&lsin, &len); /* Re-schedule a read *after* recvfrom, or we'll be registering * interest where it'll instantly be ready for read :-) -- adrian */ comm_setselect(fd, COMM_SELECT_READ, res_readreply, NULL, 0); /* Better to cast the sizeof instead of rc */ if (rc <= (int)(sizeof(HEADER))) return; /* * convert DNS reply reader from Network byte order to CPU byte order. */ header = (HEADER *)buf; header->ancount = ntohs(header->ancount); header->qdcount = ntohs(header->qdcount); header->nscount = ntohs(header->nscount); header->arcount = ntohs(header->arcount); /* * check against possibly fake replies */ if (!res_ourserver(&lsin)) return; /* * response for an id which we have already received an answer for * just ignore this response. */ if (!(request = find_id(header->id))) return; if ((header->rcode != NO_ERRORS) || (header->ancount == 0)) { if (header->rcode == SERVFAIL || header->rcode == NXDOMAIN) { /* * If a bad error was returned, stop here and don't * send any more (no retries granted). */ (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); } #ifdef IPV6 else { /* * If we havent already tried this, and we're looking up AAAA, try A * now */ if (request->state == REQ_AAAA && request->type == T_AAAA) { request->timeout += 4; resend_query(request); } } #endif return; } /* * If this fails there was an error decoding the received packet, * try it again and hope it works the next time. */ if (proc_answer(request, header, buf, buf + rc)) { if (request->type == T_PTR) { if (request->name == NULL) { /* * got a PTR response with no name, something bogus is happening * don't bother trying again, the client address doesn't resolve */ (*request->callback)(request->callback_ctx, NULL, NULL); rem_request(request); return; } /* * Lookup the 'authoritative' name that we were given for the * ip#. * */ #ifdef IPV6 if (request->addr.ss.ss_family == AF_INET6) gethost_byname_type(request->callback, request->callback_ctx, request->name, T_AAAA); else #endif gethost_byname_type(request->callback, request->callback_ctx, request->name, T_A); rem_request(request); } else { /* * got a name and address response, client resolved */ (*request->callback)(request->callback_ctx, &request->addr, request->name); rem_request(request); } } else if (!request->sent) { /* XXX - we got a response for a query we didn't send with a valid id? * this should never happen, bail here and leave the client unresolved */ assert(0); /* XXX don't leak it */ rem_request(request); } } void report_dns_servers(struct Client *source_p) { int i; char ipaddr[HOSTIPLEN + 1]; for (i = 0; i < irc_nscount; i++) { getnameinfo((struct sockaddr *)&(irc_nsaddr_list[i]), irc_nsaddr_list[i].ss_len, ipaddr, sizeof(ipaddr), NULL, 0, NI_NUMERICHOST); sendto_one(source_p, form_str(RPL_STATSALINE), me.name, source_p->name, ipaddr); } } ircd-hybrid-8.1.13.dfsg.1/src/parse.c0000644000175000017500000005360712263053413015264 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * parse.c: The message parser. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: parse.c 2787 2014-01-06 22:34:10Z michael $ */ #include "stdinc.h" #include "client.h" #include "parse.h" #include "channel.h" #include "hash.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "log.h" #include "send.h" #include "conf.h" #include "memory.h" #include "s_user.h" #include "s_serv.h" /* * (based on orabidoo's parser code) * * This has always just been a trie. Look at volume III of Knuth ACP * * * ok, you start out with an array of pointers, each one corresponds * to a letter at the current position in the command being examined. * * so roughly you have this for matching 'trie' or 'tie' * * 't' points -> [MessageTree *] 'r' -> [MessageTree *] -> 'i' * -> [MessageTree *] -> [MessageTree *] -> 'e' and matches * * 'i' -> [MessageTree *] -> 'e' and matches * * BUGS (Limitations!) * * I designed this trie to parse ircd commands. Hence it currently * casefolds. This is trivial to fix by increasing MAXPTRLEN. * This trie also "folds" '{' etc. down. This means, the input to this * trie must be alpha tokens only. This again, is a limitation that * can be overcome by increasing MAXPTRLEN to include upper/lower case * at the expense of more memory. At the extreme end, you could make * MAXPTRLEN 128. * * This is also not a patricia trie. On short ircd tokens, this is * not likely going to matter. * * Diane Bruce (Dianora), June 6 2003 */ #define MAXPTRLEN 32 /* Must be a power of 2, and * larger than 26 [a-z]|[A-Z] * its used to allocate the set * of pointers at each node of the tree * There are MAXPTRLEN pointers at each node. * Obviously, there have to be more pointers * Than ASCII letters. 32 is a nice number * since there is then no need to shift * 'A'/'a' to base 0 index, at the expense * of a few never used pointers. For a small * parser like this, this is a good compromise * and does make it somewhat faster. * * - Dianora */ struct MessageTree { int links; /* Count of all pointers (including msg) at this node * used as reference count for deletion of _this_ node. */ struct Message *msg; struct MessageTree *pointers[MAXPTRLEN]; }; static struct MessageTree msg_tree; /* * NOTE: parse() should not be called recursively by other functions! */ static char *sender; static char *para[MAXPARA + 2]; /* + + NULL */ static int cancel_clients(struct Client *, struct Client *, char *); static void remove_unknown(struct Client *, char *, char *); static void handle_numeric(char[], struct Client *, struct Client *, int, char *[]); static void handle_command(struct Message *, struct Client *, struct Client *, unsigned int, char *[]); /* * parse a buffer. * * NOTE: parse() should not be called recusively by any other functions! */ void parse(struct Client *client_p, char *pbuffer, char *bufend) { struct Client *from = client_p; struct Message *msg_ptr = NULL; char *ch = NULL; char *s = NULL; char *numeric = NULL; unsigned int parc = 0; unsigned int paramcount; if (IsDefunct(client_p)) return; assert(client_p->localClient->fd.flags.open); assert((bufend - pbuffer) < IRCD_BUFSIZE); for (ch = pbuffer; *ch == ' '; ++ch) /* skip spaces */ /* null statement */ ; if (*ch == ':') { /* * Copy the prefix to 'sender' assuming it terminates * with SPACE (or NULL, which is an error, though). */ sender = ++ch; if ((s = strchr(ch, ' ')) != NULL) { *s = '\0'; ch = ++s; } if (*sender && IsServer(client_p)) { if ((from = find_person(client_p, sender)) == NULL) from = hash_find_server(sender); /* * Hmm! If the client corresponding to the prefix is not found--what is * the correct action??? Now, I will ignore the message (old IRC just * let it through as if the prefix just wasn't there...) --msa */ if (from == NULL) { ++ServerStats.is_unpf; remove_unknown(client_p, sender, pbuffer); return; } if (from->from != client_p) { ++ServerStats.is_wrdi; cancel_clients(client_p, from, pbuffer); return; } } while (*ch == ' ') ++ch; } if (*ch == '\0') { ++ServerStats.is_empt; return; } /* * Extract the command code from the packet. Point s to the end * of the command code and calculate the length using pointer * arithmetic. Note: only need length for numerics and *all* * numerics must have parameters and thus a space after the command * code. -avalon */ /* EOB is 3 chars long but is not a numeric */ if (*(ch + 3) == ' ' && /* ok, lets see if its a possible numeric.. */ IsDigit(*ch) && IsDigit(*(ch + 1)) && IsDigit(*(ch + 2))) { numeric = ch; paramcount = 2; /* destination, and the rest of it */ ++ServerStats.is_num; s = ch + 3; /* I know this is ' ' from above if */ *s++ = '\0'; /* blow away the ' ', and point s to next part */ } else { unsigned int ii = 0; if ((s = strchr(ch, ' ')) != NULL) *s++ = '\0'; if ((msg_ptr = find_command(ch)) == NULL) { /* * Note: Give error message *only* to recognized * persons. It's a nightmare situation to have * two programs sending "Unknown command"'s or * equivalent to each other at full blast.... * If it has got to person state, it at least * seems to be well behaving. Perhaps this message * should never be generated, though... --msa * Hm, when is the buffer empty -- if a command * code has been found ?? -Armin */ if (*pbuffer != '\0') { if (IsClient(from)) sendto_one(from, form_str(ERR_UNKNOWNCOMMAND), me.name, from->name, ch); } ++ServerStats.is_unco; return; } assert(msg_ptr->cmd != NULL); paramcount = msg_ptr->args_max; ii = bufend - ((s) ? s : ch); msg_ptr->bytes += ii; } /* * Must the following loop really be so devious? On surface it * splits the message to parameters from blank spaces. But, if * paramcount has been reached, the rest of the message goes into * this last parameter (about same effect as ":" has...) --msa */ /* Note initially true: s==NULL || *(s-1) == '\0' !! */ para[parc] = from->name; if (s) { if (paramcount > MAXPARA) paramcount = MAXPARA; while (1) { while (*s == ' ') *s++ = '\0'; if (*s == '\0') break; if (*s == ':') { /* The rest is a single parameter */ para[++parc] = s + (!numeric); /* keep the colon if it's a numeric */ break; } para[++parc] = s; if (parc >= paramcount) break; while (*s && *s != ' ') ++s; } } para[++parc] = NULL; if (msg_ptr != NULL) handle_command(msg_ptr, client_p, from, parc, para); else handle_numeric(numeric, client_p, from, parc, para); } /* handle_command() * * inputs - pointer to message block * - pointer to client * - pointer to client message is from * - count of number of args * - pointer to argv[] array * output - -1 if error from server * side effects - */ static void handle_command(struct Message *mptr, struct Client *client_p, struct Client *from, unsigned int i, char *hpara[]) { MessageHandler handler = 0; if (IsServer(client_p)) mptr->rcount++; mptr->count++; handler = mptr->handlers[client_p->handler]; /* check right amount of params is passed... --is */ if (i < mptr->args_min) { if (!IsServer(client_p)) { sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS), me.name, EmptyString(hpara[0]) ? "*" : hpara[0], mptr->cmd); } else { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Dropping server %s due to (invalid) command '%s' " "with only %d arguments (expecting %d).", client_p->name, mptr->cmd, i, mptr->args_min); ilog(LOG_TYPE_IRCD, "Insufficient parameters (%d) for command '%s' from %s.", i, mptr->cmd, client_p->name); exit_client(client_p, client_p, "Not enough arguments to server command."); } } else (*handler)(client_p, from, i, hpara); } /* add_msg_element() * * inputs - pointer to MessageTree * - pointer to Message to add for given command * - pointer to current portion of command being added * output - NONE * side effects - recursively build the Message Tree ;-) */ /* * How this works. * * The code first checks to see if its reached the end of the command * If so, that struct MessageTree has a msg pointer updated and the links * count incremented, since a msg pointer is a reference. * Then the code descends recursively, building the trie. * If a pointer index inside the struct MessageTree is NULL a new * child struct MessageTree has to be allocated. * The links (reference count) is incremented as they are created * in the parent. */ static void add_msg_element(struct MessageTree *mtree_p, struct Message *msg_p, const char *cmd) { struct MessageTree *ntree_p; if (*cmd == '\0') { mtree_p->msg = msg_p; mtree_p->links++; /* Have msg pointer, so up ref count */ } else { /* * *cmd & (MAXPTRLEN-1) * convert the char pointed to at *cmd from ASCII to an integer * between 0 and MAXPTRLEN. * Thus 'A' -> 0x1 'B' -> 0x2 'c' -> 0x3 etc. */ if ((ntree_p = mtree_p->pointers[*cmd & (MAXPTRLEN - 1)]) == NULL) { ntree_p = MyMalloc(sizeof(struct MessageTree)); mtree_p->pointers[*cmd & (MAXPTRLEN - 1)] = ntree_p; mtree_p->links++; /* Have new pointer, so up ref count */ } add_msg_element(ntree_p, msg_p, cmd + 1); } } /* del_msg_element() * * inputs - Pointer to MessageTree to delete from * - pointer to command name to delete * output - NONE * side effects - recursively deletes a token from the Message Tree ;-) */ /* * How this works. * * Well, first off, the code recursively descends into the trie * until it finds the terminating letter of the command being removed. * Once it has done that, it marks the msg pointer as NULL then * reduces the reference count on that allocated struct MessageTree * since a command counts as a reference. * * Then it pops up the recurse stack. As it comes back up the recurse * The code checks to see if the child now has no pointers or msg * i.e. the links count has gone to zero. If its no longer used, the * child struct MessageTree can be deleted. The parent reference * to this child is then removed and the parents link count goes down. * Thus, we continue to go back up removing all unused MessageTree(s) */ static void del_msg_element(struct MessageTree *mtree_p, const char *cmd) { struct MessageTree *ntree_p; /* * In case this is called for a nonexistent command * check that there is a msg pointer here, else links-- goes -ve * -db */ if ((*cmd == '\0') && (mtree_p->msg != NULL)) { mtree_p->msg = NULL; mtree_p->links--; } else { if ((ntree_p = mtree_p->pointers[*cmd & (MAXPTRLEN - 1)]) != NULL) { del_msg_element(ntree_p, cmd + 1); if (ntree_p->links == 0) { mtree_p->pointers[*cmd & (MAXPTRLEN - 1)] = NULL; mtree_p->links--; MyFree(ntree_p); } } } } /* msg_tree_parse() * * inputs - Pointer to command to find * - Pointer to MessageTree root * output - Find given command returning Message * if found NULL if not * side effects - none */ static struct Message * msg_tree_parse(const char *cmd) { struct MessageTree *mtree = &msg_tree; assert(cmd && *cmd); while (IsAlpha(*cmd) && (mtree = mtree->pointers[*cmd & (MAXPTRLEN - 1)])) if (*++cmd == '\0') return mtree->msg; return NULL; } /* mod_add_cmd() * * inputs - pointer to struct Message * output - none * side effects - load this one command name * msg->count msg->bytes is modified in place, in * modules address space. Might not want to do that... */ void mod_add_cmd(struct Message *msg) { assert(msg && msg->cmd); /* command already added? */ if (msg_tree_parse(msg->cmd)) return; add_msg_element(&msg_tree, msg, msg->cmd); msg->count = msg->rcount = msg->bytes = 0; } /* mod_del_cmd() * * inputs - pointer to struct Message * output - none * side effects - unload this one command name */ void mod_del_cmd(struct Message *msg) { assert(msg && msg->cmd); del_msg_element(&msg_tree, msg->cmd); } /* find_command() * * inputs - command name * output - pointer to struct Message * side effects - none */ struct Message * find_command(const char *cmd) { return msg_tree_parse(cmd); } static void recurse_report_messages(struct Client *source_p, const struct MessageTree *mtree) { unsigned int i; if (mtree->msg != NULL) sendto_one(source_p, form_str(RPL_STATSCOMMANDS), me.name, source_p->name, mtree->msg->cmd, mtree->msg->count, mtree->msg->bytes, mtree->msg->rcount); for (i = 0; i < MAXPTRLEN; ++i) if (mtree->pointers[i] != NULL) recurse_report_messages(source_p, mtree->pointers[i]); } /* report_messages() * * inputs - pointer to client to report to * output - NONE * side effects - client is shown list of commands */ void report_messages(struct Client *source_p) { const struct MessageTree *mtree = &msg_tree; unsigned int i; for (i = 0; i < MAXPTRLEN; ++i) if (mtree->pointers[i] != NULL) recurse_report_messages(source_p, mtree->pointers[i]); } /* cancel_clients() * * inputs - * output - * side effects - */ static int cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd) { /* * Kill all possible points that are causing confusion here, * I'm not sure I've got this all right... * - avalon * * Knowing avalon, probably not. */ /* * With TS, fake prefixes are a common thing, during the * connect burst when there's a nick collision, and they * must be ignored rather than killed because one of the * two is surviving.. so we don't bother sending them to * all ops everytime, as this could send 'private' stuff * from lagged clients. we do send the ones that cause * servers to be dropped though, as well as the ones from * non-TS servers -orabidoo */ /* * Incorrect prefix for a server from some connection. If it is a * client trying to be annoying, just QUIT them, if it is a server * then the same deal. */ if (IsServer(source_p) || IsMe(source_p)) { sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE, "Message for %s[%s] from %s", source_p->name, source_p->from->name, get_client_name(client_p, SHOW_IP)); sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE, "Message for %s[%s] from %s", source_p->name, source_p->from->name, get_client_name(client_p, MASK_IP)); sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, "Not dropping server %s (%s) for Fake Direction", client_p->name, source_p->name); return -1; /* return exit_client(client_p, client_p, &me, "Fake Direction");*/ } /* * Ok, someone is trying to impose as a client and things are * confused. If we got the wrong prefix from a server, send out a * kill, else just exit the lame client. */ /* * If the fake prefix is coming from a TS server, discard it * silently -orabidoo * * all servers must be TS these days --is */ sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE, "Message for %s[%s@%s!%s] from %s (TS, ignored)", source_p->name, source_p->username, source_p->host, source_p->from->name, get_client_name(client_p, SHOW_IP)); sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE, "Message for %s[%s@%s!%s] from %s (TS, ignored)", source_p->name, source_p->username, source_p->host, source_p->from->name, get_client_name(client_p, MASK_IP)); return 0; } /* remove_unknown() * * inputs - * output - * side effects - */ static void remove_unknown(struct Client *client_p, char *lsender, char *lbuffer) { /* * Do kill if it came from a server because it means there is a ghost * user on the other server which needs to be removed. -avalon * Tell opers about this. -Taner */ /* * '[0-9]something' is an ID (KILL/SQUIT depending on its length) * 'nodots' is a nickname (KILL) * 'no.dot.at.start' is a server (SQUIT) */ if ((IsDigit(*lsender) && strlen(lsender) <= IRC_MAXSID) || strchr(lsender, '.') != NULL) { sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE, "Unknown prefix (%s) from %s, Squitting %s", lbuffer, get_client_name(client_p, SHOW_IP), lsender); sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE, "Unknown prefix (%s) from %s, Squitting %s", lbuffer, client_p->name, lsender); sendto_one(client_p, ":%s SQUIT %s :(Unknown prefix (%s) from %s)", me.name, lsender, lbuffer, client_p->name); } else sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)", me.name, lsender, me.name); } /* * * parc number of arguments ('sender' counted as one!) * parv[0] pointer to 'sender' (may point to empty string) (not used) * parv[1]..parv[parc-1] * pointers to additional parameters, this is a NULL * terminated list (parv[parc] == NULL). * * *WARNING* * Numerics are mostly error reports. If there is something * wrong with the message, just *DROP* it! Don't even think of * sending back a neat error message -- big danger of creating * a ping pong error message... * * Rewritten by Nemesi, Jan 1999, to support numeric nicks in parv[1] * * Called when we get a numeric message from a remote _server_ and we are * supposed to forward it somewhere. Note that we always ignore numerics sent * to 'me' and simply drop the message if we can't handle with this properly: * the savvy approach is NEVER generate an error in response to an... error :) */ static void handle_numeric(char numeric[], struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { struct Client *target_p = NULL; struct Channel *chptr = NULL; /* * Avoid trash, we need it to come from a server and have a target */ if (parc < 2 || !IsServer(source_p)) return; /* * Who should receive this message ? Will we do something with it ? * Note that we use findUser functions, so the target can't be neither * a server, nor a channel (?) nor a list of targets (?) .. u2.10 * should never generate numeric replies to non-users anyway * Ahem... it can be a channel actually, csc bots use it :\ --Nem */ if (IsChanPrefix(*parv[1])) chptr = hash_find_channel(parv[1]); else target_p = find_person(client_p, parv[1]); if (((!target_p) || (target_p->from == client_p)) && !chptr) return; /* * Remap low number numerics, not that I understand WHY.. --Nemesi */ /* * Numerics below 100 talk about the current 'connection', you're not * connected to a remote server so it doesn't make sense to send them * remotely - but the information they contain may be useful, so we * remap them up. Weird, but true. -- Isomer */ if (numeric[0] == '0') numeric[0] = '1'; if (target_p) { /* Fake it for server hiding, if its our client */ if (ConfigServerHide.hide_servers && MyClient(target_p) && !HasUMode(target_p, UMODE_OPER)) sendto_one(target_p, ":%s %s %s %s", me.name, numeric, target_p->name, parv[2]); else sendto_one(target_p, ":%s %s %s %s", ID_or_name(source_p, target_p->from), numeric, ID_or_name(target_p, target_p->from), parv[2]); } else sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s %s %s %s", source_p->name, numeric, chptr->chname, parv[2]); } /* m_not_oper() * inputs - * output - * side effects - just returns a nastyogram to given user */ void m_not_oper(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, source_p->name); } void m_unregistered(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { sendto_one(source_p, form_str(ERR_NOTREGISTERED), me.name, source_p->name[0] ? source_p->name : "*"); } void m_registered(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { sendto_one(source_p, form_str(ERR_ALREADYREGISTRED), me.name, source_p->name); } void m_ignore(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { return; } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd_select.c0000644000175000017500000001116712263053413016576 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd_select.c: select() compatible network routines. * * Originally by Adrian Chadd * Copyright (C) 2002 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd_select.c 2724 2013-12-29 13:00:42Z michael $ */ #include "stdinc.h" #if USE_IOPOLL_MECHANISM == __IOPOLL_MECHANISM_SELECT #include "list.h" #include "fdlist.h" #include "hook.h" #include "ircd.h" #include "s_bsd.h" #include "log.h" /* * Note that this is only a single list - multiple lists is kinda pointless * under select because the list size is a function of the highest FD :-) * -- adrian */ static fd_set select_readfds, tmpreadfds; static fd_set select_writefds, tmpwritefds; static int highest_fd = -1; /* * init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ void init_netio(void) { FD_ZERO(&select_readfds); FD_ZERO(&select_writefds); } /* * comm_setselect * * This is a needed exported function which will be called to register * and deregister interest in a pending IO state for a given FD. */ void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) { int new_events; if ((type & COMM_SELECT_READ)) { F->read_handler = handler; F->read_data = client_data; } if ((type & COMM_SELECT_WRITE)) { F->write_handler = handler; F->write_data = client_data; } new_events = (F->read_handler ? COMM_SELECT_READ : 0) | (F->write_handler ? COMM_SELECT_WRITE : 0); if (timeout != 0) { F->timeout = CurrentTime + (timeout / 1000); F->timeout_handler = handler; F->timeout_data = client_data; } if (new_events != F->evcache) { if ((new_events & COMM_SELECT_READ)) FD_SET(F->fd, &select_readfds); else { FD_CLR(F->fd, &select_readfds); FD_CLR(F->fd, &tmpreadfds); } if ((new_events & COMM_SELECT_WRITE)) FD_SET(F->fd, &select_writefds); else { FD_CLR(F->fd, &select_writefds); FD_CLR(F->fd, &tmpwritefds); } if (new_events == 0) { if (highest_fd == F->fd) while (highest_fd >= 0 && (FD_ISSET(highest_fd, &select_readfds) || FD_ISSET(highest_fd, &select_writefds))) highest_fd--; } else if (F->evcache == 0) if (F->fd > highest_fd) highest_fd = F->fd; F->evcache = new_events; } } /* * comm_select * * Called to do the new-style IO, courtesy of squid (like most of this * new IO code). This routine handles the stuff we've hidden in * comm_setselect and fd_table[] and calls callbacks for IO ready * events. */ void comm_select(void) { struct timeval to; int num, fd; fde_t *F; PF *hdl; /* Copy over the read/write sets so we don't have to rebuild em */ memcpy(&tmpreadfds, &select_readfds, sizeof(fd_set)); memcpy(&tmpwritefds, &select_writefds, sizeof(fd_set)); to.tv_sec = 0; to.tv_usec = SELECT_DELAY * 1000; num = select(highest_fd + 1, &tmpreadfds, &tmpwritefds, NULL, &to); set_time(); if (num < 0) { #ifdef HAVE_USLEEP usleep(50000); #endif return; } for (fd = 0; fd <= highest_fd && num > 0; fd++) { if (FD_ISSET(fd, &tmpreadfds) || FD_ISSET(fd, &tmpwritefds)) { num--; F = lookup_fd(fd); if (F == NULL || !F->flags.open) continue; if (FD_ISSET(fd, &tmpreadfds)) { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); if (!F->flags.open) continue; } } if (FD_ISSET(fd, &tmpwritefds)) { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); if (!F->flags.open) continue; } } comm_setselect(F, 0, NULL, NULL, 0); } } } #endif ircd-hybrid-8.1.13.dfsg.1/src/send.c0000644000175000017500000007317012263053413015100 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * send.c: Functions for sending messages. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: send.c 2653 2013-12-11 17:45:22Z michael $ */ #include "stdinc.h" #include "list.h" #include "send.h" #include "channel.h" #include "client.h" #include "dbuf.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "fdlist.h" #include "s_bsd.h" #include "s_serv.h" #include "conf.h" #include "log.h" #include "memory.h" #include "packet.h" static unsigned int current_serial = 0; /* send_format() * * inputs - buffer to format into * - size of the buffer * - format pattern to use * - var args * output - number of bytes formatted output * side effects - modifies sendbuf */ static inline int send_format(char *lsendbuf, int bufsize, const char *pattern, va_list args) { int len; /* * from rfc1459 * * IRC messages are always lines of characters terminated with a CR-LF * (Carriage Return - Line Feed) pair, and these messages shall not * exceed 512 characters in length, counting all characters * including the trailing CR-LF. * Thus, there are 510 characters maximum allowed * for the command and its parameters. There is no provision for * continuation message lines. See section 7 for more details about * current implementations. */ len = vsnprintf(lsendbuf, bufsize - 1, pattern, args); if (len > bufsize - 2) len = bufsize - 2; /* required by some versions of vsnprintf */ lsendbuf[len++] = '\r'; lsendbuf[len++] = '\n'; return len; } /* ** send_message ** Internal utility which appends given buffer to the sockets ** sendq. */ static void send_message(struct Client *to, char *buf, int len) { assert(!IsMe(to)); assert(to != &me); if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(&to->localClient->confs)) { if (IsServer(to)) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Max SendQ limit exceeded for %s: %lu > %u", get_client_name(to, HIDE_IP), (unsigned long)(dbuf_length(&to->localClient->buf_sendq) + len), get_sendq(&to->localClient->confs)); if (IsClient(to)) SetSendQExceeded(to); dead_link_on_write(to, 0); return; } dbuf_put(&to->localClient->buf_sendq, buf, len); /* ** Update statistics. The following is slightly incorrect ** because it counts messages even if queued, but bytes ** only really sent. Queued bytes get updated in SendQueued. */ ++to->localClient->send.messages; ++me.localClient->send.messages; if (dbuf_length(&to->localClient->buf_sendq) > (IsServer(to) ? (unsigned int) 1024 : (unsigned int) 4096)) send_queued_write(to); } /* send_message_remote() * * inputs - pointer to client from message is being sent * - pointer to client to send to * - pointer to preformatted buffer * - length of input buffer * output - none * side effects - Despite the function name, this only sends to directly * connected clients. * */ static void send_message_remote(struct Client *to, struct Client *from, char *buf, int len) { if (!MyConnect(to)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Server send message to %s [%s] dropped from %s(Not local server)", to->name, to->from->name, from->name); return; } /* Optimize by checking if (from && to) before everything */ /* we set to->from up there.. */ if (!MyClient(from) && IsClient(to) && (to == from->from)) { if (IsServer(from)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Send message to %s [%s] dropped from %s(Fake Dir)", to->name, to->from->name, from->name); return; } sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Ghosted: %s[%s@%s] from %s[%s@%s] (%s)", to->name, to->username, to->host, from->name, from->username, from->host, to->from->name); sendto_server(NULL, CAP_TS6, NOCAPS, ":%s KILL %s :%s (%s[%s@%s] Ghosted %s)", me.id, to->name, me.name, to->name, to->username, to->host, to->from->name); sendto_server(NULL, NOCAPS, CAP_TS6, ":%s KILL %s :%s (%s[%s@%s] Ghosted %s)", me.name, to->name, me.name, to->name, to->username, to->host, to->from->name); AddFlag(to, FLAGS_KILLED); if (IsClient(from)) sendto_one(from, form_str(ERR_GHOSTEDCLIENT), me.name, from->name, to->name, to->username, to->host, to->from); exit_client(to, &me, "Ghosted client"); return; } send_message(to, buf, len); } /* ** sendq_unblocked ** Called when a socket is ready for writing. */ void sendq_unblocked(fde_t *fd, struct Client *client_p) { ClearSendqBlocked(client_p); /* let send_queued_write be executed by send_queued_all */ #ifdef HAVE_LIBCRYPTO if (fd->flags.pending_read) { fd->flags.pending_read = 0; read_packet(fd, client_p); } #endif } /* ** send_queued_write ** This is called when there is a chance that some output would ** be possible. This attempts to empty the send queue as far as ** possible, and then if any data is left, a write is rescheduled. */ void send_queued_write(struct Client *to) { int retlen = 0; struct dbuf_block *first = NULL; /* ** Once socket is marked dead, we cannot start writing to it, ** even if the error is removed... */ if (IsDead(to) || IsSendqBlocked(to)) return; /* no use calling send() now */ /* Next, lets try to write some data */ if (dbuf_length(&to->localClient->buf_sendq)) { do { first = to->localClient->buf_sendq.blocks.head->data; #ifdef HAVE_LIBCRYPTO if (to->localClient->fd.ssl) { retlen = SSL_write(to->localClient->fd.ssl, first->data, first->size); /* translate openssl error codes, sigh */ if (retlen < 0) { switch (SSL_get_error(to->localClient->fd.ssl, retlen)) { case SSL_ERROR_WANT_READ: return; /* retry later, don't register for write events */ case SSL_ERROR_WANT_WRITE: errno = EWOULDBLOCK; case SSL_ERROR_SYSCALL: break; case SSL_ERROR_SSL: if (errno == EAGAIN) break; default: retlen = errno = 0; /* either an SSL-specific error or EOF */ } } } else #endif retlen = send(to->localClient->fd.fd, first->data, first->size, 0); if (retlen <= 0) break; dbuf_delete(&to->localClient->buf_sendq, retlen); /* We have some data written .. update counters */ to->localClient->send.bytes += retlen; me.localClient->send.bytes += retlen; } while (dbuf_length(&to->localClient->buf_sendq)); if ((retlen < 0) && (ignoreErrno(errno))) { /* we have a non-fatal error, reschedule a write */ SetSendqBlocked(to); comm_setselect(&to->localClient->fd, COMM_SELECT_WRITE, (PF *)sendq_unblocked, to, 0); } else if (retlen <= 0) { dead_link_on_write(to, errno); return; } } } /* send_queued_all() * * input - NONE * output - NONE * side effects - try to flush sendq of each client */ void send_queued_all(void) { dlink_node *ptr; /* Servers are processed first, mainly because this can generate * a notice to opers, which is to be delivered by this function. */ DLINK_FOREACH(ptr, serv_list.head) send_queued_write(ptr->data); DLINK_FOREACH(ptr, unknown_list.head) send_queued_write(ptr->data); DLINK_FOREACH(ptr, local_client_list.head) send_queued_write(ptr->data); /* NOTE: This can still put clients on aborted_list; unfortunately, * exit_aborted_clients takes precedence over send_queued_all, * because exiting clients can generate server/oper traffic. * The easiest approach is dealing with aborted clients in the next I/O lap. * -adx */ } /* sendto_one() * * inputs - pointer to destination client * - var args message * output - NONE * side effects - send message to single client */ void sendto_one(struct Client *to, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len; if (to->from != NULL) to = to->from; if (IsDead(to)) return; /* This socket has already been marked as dead */ va_start(args, pattern); len = send_format(buffer, sizeof(buffer), pattern, args); va_end(args); send_message(to, buffer, len); } /* sendto_channel_butone() * * inputs - pointer to client(server) to NOT send message to * - pointer to client that is sending this message * - pointer to channel being sent to * - vargs message * output - NONE * side effects - message as given is sent to given channel members. * * WARNING - +D clients are ignored */ void sendto_channel_butone(struct Client *one, struct Client *from, struct Channel *chptr, unsigned int type, const char *pattern, ...) { va_list alocal, aremote, auid; char local_buf[IRCD_BUFSIZE]; char remote_buf[IRCD_BUFSIZE]; char uid_buf[IRCD_BUFSIZE]; int local_len, remote_len, uid_len; dlink_node *ptr = NULL, *ptr_next = NULL; if (IsServer(from)) local_len = snprintf(local_buf, sizeof(local_buf), ":%s ", from->name); else local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ", from->name, from->username, from->host); remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ", from->name); uid_len = snprintf(uid_buf, sizeof(uid_buf), ":%s ", ID(from)); va_start(alocal, pattern); va_start(aremote, pattern); va_start(auid, pattern); local_len += send_format(&local_buf[local_len], IRCD_BUFSIZE - local_len, pattern, alocal); remote_len += send_format(&remote_buf[remote_len], IRCD_BUFSIZE - remote_len, pattern, aremote); uid_len += send_format(&uid_buf[uid_len], IRCD_BUFSIZE - uid_len, pattern, auid); va_end(auid); va_end(aremote); va_end(alocal); ++current_serial; DLINK_FOREACH_SAFE(ptr, ptr_next, chptr->members.head) { struct Membership *ms = ptr->data; struct Client *target_p = ms->client_p; assert(IsClient(target_p)); if (IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF) || target_p->from == one) continue; if (type != 0 && (ms->flags & type) == 0) continue; if (MyConnect(target_p)) { if (target_p->localClient->serial != current_serial) { send_message(target_p, local_buf, local_len); target_p->localClient->serial = current_serial; } } else { /* Now check whether a message has been sent to this * remote link already */ if (target_p->from->localClient->serial != current_serial) { if (IsCapable(target_p->from, CAP_TS6)) send_message_remote(target_p->from, from, uid_buf, uid_len); else send_message_remote(target_p->from, from, remote_buf, remote_len); target_p->from->localClient->serial = current_serial; } } } } /* sendto_server() * * inputs - pointer to client to NOT send to * - pointer to channel * - caps or'd together which must ALL be present * - caps or'd together which must ALL NOT be present * - printf style format string * - args to format string * output - NONE * side effects - Send a message to all connected servers, except the * client 'one' (if non-NULL), as long as the servers * support ALL capabs in 'caps', and NO capabs in 'nocaps'. * * This function was written in an attempt to merge together the other * billion sendto_*serv*() functions, which sprung up with capabs, * lazylinks, uids, etc. * -davidt */ void sendto_server(struct Client *one, const unsigned int caps, const unsigned int nocaps, const char *format, ...) { va_list args; dlink_node *ptr = NULL; char buffer[IRCD_BUFSIZE]; int len = 0; va_start(args, format); len = send_format(buffer, sizeof(buffer), format, args); va_end(args); DLINK_FOREACH(ptr, serv_list.head) { struct Client *client_p = ptr->data; /* If dead already skip */ if (IsDead(client_p)) continue; /* check against 'one' */ if (one != NULL && (client_p == one->from)) continue; /* check we have required capabs */ if ((client_p->localClient->caps & caps) != caps) continue; /* check we don't have any forbidden capabs */ if ((client_p->localClient->caps & nocaps) != 0) continue; send_message(client_p, buffer, len); } } /* sendto_common_channels_local() * * inputs - pointer to client * - pattern to send * output - NONE * side effects - Sends a message to all people on local server who are * in same channel with user. * used by m_nick.c and exit_one_client. */ void sendto_common_channels_local(struct Client *user, int touser, unsigned int cap, const char *pattern, ...) { va_list args; dlink_node *uptr; dlink_node *cptr; struct Channel *chptr; struct Membership *ms; struct Client *target_p; char buffer[IRCD_BUFSIZE]; int len; va_start(args, pattern); len = send_format(buffer, sizeof(buffer), pattern, args); va_end(args); ++current_serial; DLINK_FOREACH(cptr, user->channel.head) { chptr = ((struct Membership *)cptr->data)->chptr; assert(chptr != NULL); DLINK_FOREACH(uptr, chptr->members.head) { ms = uptr->data; target_p = ms->client_p; assert(target_p != NULL); if (!MyConnect(target_p) || target_p == user || IsDefunct(target_p) || target_p->localClient->serial == current_serial) continue; if (HasCap(target_p, cap) != cap) continue; target_p->localClient->serial = current_serial; send_message(target_p, buffer, len); } } if (touser && MyConnect(user) && !IsDead(user) && user->localClient->serial != current_serial) if (HasCap(user, cap) == cap) send_message(user, buffer, len); } /* sendto_channel_local() * * inputs - member status mask, e.g. CHFL_CHANOP | CHFL_VOICE * - whether to ignore +D clients (YES/NO) * - pointer to channel to send to * - var args pattern * output - NONE * side effects - Send a message to all members of a channel that are * locally connected to this server. */ void sendto_channel_local(unsigned int type, int nodeaf, struct Channel *chptr, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len = 0; dlink_node *ptr = NULL; va_start(args, pattern); len = send_format(buffer, sizeof(buffer), pattern, args); va_end(args); DLINK_FOREACH(ptr, chptr->members.head) { struct Membership *ms = ptr->data; struct Client *target_p = ms->client_p; if (type != 0 && (ms->flags & type) == 0) continue; if (!MyConnect(target_p) || IsDefunct(target_p) || (nodeaf && HasUMode(target_p, UMODE_DEAF))) continue; send_message(target_p, buffer, len); } } /* sendto_channel_local_butone() * * inputs - pointer to client to NOT send message to * - member status mask, e.g. CHFL_CHANOP | CHFL_VOICE * - pointer to channel to send to * - var args pattern * output - NONE * side effects - Send a message to all members of a channel that are * locally connected to this server except one. * * WARNING - +D clients are omitted */ void sendto_channel_local_butone(struct Client *one, unsigned int type, unsigned int cap, struct Channel *chptr, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len = 0; dlink_node *ptr = NULL; va_start(args, pattern); len = send_format(buffer, sizeof(buffer), pattern, args); va_end(args); DLINK_FOREACH(ptr, chptr->members.head) { struct Membership *ms = ptr->data; struct Client *target_p = ms->client_p; if (type != 0 && (ms->flags & type) == 0) continue; if (!MyConnect(target_p) || target_p == one || IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF)) continue; if (HasCap(target_p, cap) != cap) continue; send_message(target_p, buffer, len); } } /* sendto_channel_remote() * * inputs - Client not to send towards * - Client from whom message is from * - member status mask, e.g. CHFL_CHANOP | CHFL_VOICE * - pointer to channel to send to * - var args pattern * output - NONE * side effects - Send a message to all members of a channel that are * remote to this server. */ void sendto_channel_remote(struct Client *one, struct Client *from, unsigned int type, const unsigned int caps, const unsigned int nocaps, struct Channel *chptr, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len = 0; dlink_node *ptr = NULL; va_start(args, pattern); len = send_format(buffer, sizeof(buffer), pattern, args); va_end(args); ++current_serial; DLINK_FOREACH(ptr, chptr->members.head) { struct Membership *ms = ptr->data; struct Client *target_p = ms->client_p; if (type != 0 && (ms->flags & type) == 0) continue; if (MyConnect(target_p)) continue; target_p = target_p->from; if (target_p == one->from || ((target_p->from->localClient->caps & caps) != caps) || ((target_p->from->localClient->caps & nocaps) != 0)) continue; if (target_p->from->localClient->serial != current_serial) { send_message(target_p, buffer, len); target_p->from->localClient->serial = current_serial; } } } /* ** match_it() and sendto_match_butone() ARE only used ** to send a msg to all ppl on servers/hosts that match a specified mask ** (used for enhanced PRIVMSGs) for opers ** ** addition -- Armin, 8jun90 (gruner@informatik.tu-muenchen.de) ** */ /* match_it() * * inputs - client pointer to match on * - actual mask to match * - what to match on, HOST or SERVER * output - 1 or 0 if match or not * side effects - NONE */ static int match_it(const struct Client *one, const char *mask, int what) { if (what == MATCH_HOST) return !match(mask, one->host); return !match(mask, one->servptr->name); } /* sendto_match_butone() * * Send to all clients which match the mask in a way defined on 'what'; * either by user hostname or user servername. * * ugh. ONLY used by m_message.c to send an "oper magic" message. ugh. */ void sendto_match_butone(struct Client *one, struct Client *from, char *mask, int what, const char *pattern, ...) { va_list alocal, aremote; struct Client *client_p; dlink_node *ptr, *ptr_next; char local_buf[IRCD_BUFSIZE], remote_buf[IRCD_BUFSIZE]; int local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ", from->name, from->username, from->host); int remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ", from->name); va_start(alocal, pattern); va_start(aremote, pattern); local_len += send_format(&local_buf[local_len], IRCD_BUFSIZE - local_len, pattern, alocal); remote_len += send_format(&remote_buf[remote_len], IRCD_BUFSIZE - remote_len, pattern, aremote); va_end(aremote); va_end(alocal); /* scan the local clients */ DLINK_FOREACH(ptr, local_client_list.head) { client_p = ptr->data; if (client_p != one && !IsDefunct(client_p) && match_it(client_p, mask, what)) send_message(client_p, local_buf, local_len); } /* Now scan servers */ DLINK_FOREACH_SAFE(ptr, ptr_next, serv_list.head) { client_p = ptr->data; /* * The old code looped through every client on the * network for each server to check if the * server (client_p) has at least 1 client matching * the mask, using something like: * * for (target_p = GlobalClientList; target_p; target_p = target_p->next) * if (IsRegisteredUser(target_p) && * match_it(target_p, mask, what) && * (target_p->from == client_p)) * vsendto_prefix_one(client_p, from, pattern, args); * * That way, we wouldn't send the message to * a server who didn't have a matching client. * However, on a network such as EFNet, that * code would have looped through about 50 * servers, and in each loop, loop through * about 50k clients as well, calling match() * in each nested loop. That is a very bad * thing cpu wise - just send the message * to every connected server and let that * server deal with it. * -wnder */ if (client_p != one && !IsDefunct(client_p)) send_message_remote(client_p, from, remote_buf, remote_len); } } /* sendto_match_servs() * * inputs - source client * - mask to send to * - capab needed * - data * outputs - none * side effects - data sent to servers matching with capab */ void sendto_match_servs(struct Client *source_p, const char *mask, unsigned int cap, const char *pattern, ...) { va_list args; dlink_node *ptr = NULL; char buffer[IRCD_BUFSIZE]; va_start(args, pattern); vsnprintf(buffer, sizeof(buffer), pattern, args); va_end(args); ++current_serial; DLINK_FOREACH(ptr, global_serv_list.head) { struct Client *target_p = ptr->data; /* Do not attempt to send to ourselves, or the source */ if (IsMe(target_p) || target_p->from == source_p->from) continue; if (target_p->from->localClient->serial == current_serial) continue; if (!match(mask, target_p->name)) { /* * if we set the serial here, then we'll never do a * match() again, if !IsCapable() */ target_p->from->localClient->serial = current_serial; if (!IsCapable(target_p->from, cap)) continue; sendto_anywhere(target_p, source_p, "%s", buffer); } } } /* sendto_anywhere() * * inputs - pointer to dest client * - pointer to from client * - varags * output - NONE * side effects - less efficient than sendto_remote and sendto_one * but useful when one does not know where target "lives" */ void sendto_anywhere(struct Client *to, struct Client *from, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len; struct Client *send_to = (to->from != NULL ? to->from : to); if (IsDead(send_to)) return; if (MyClient(to)) { if (IsServer(from)) len = snprintf(buffer, sizeof(buffer), ":%s ", from->name); else len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s ", from->name, from->username, from->host); } else len = snprintf(buffer, sizeof(buffer), ":%s ", ID_or_name(from, send_to)); va_start(args, pattern); len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); va_end(args); if (MyClient(to)) send_message(send_to, buffer, len); else send_message_remote(send_to, from, buffer, len); } /* sendto_realops_flags() * * inputs - flag types of messages to show to real opers * - flag indicating opers/admins * - var args input message * output - NONE * side effects - Send to *local* ops only but NOT +s nonopers. */ void sendto_realops_flags(unsigned int flags, int level, int type, const char *pattern, ...) { const char *ntype = NULL; dlink_node *ptr = NULL; char nbuf[IRCD_BUFSIZE]; va_list args; va_start(args, pattern); vsnprintf(nbuf, sizeof(nbuf), pattern, args); va_end(args); switch (type) { case SEND_NOTICE: ntype = "Notice"; break; case SEND_GLOBAL: ntype = "Global"; break; case SEND_LOCOPS: ntype = "LocOps"; break; default: assert(0); } DLINK_FOREACH(ptr, oper_list.head) { struct Client *client_p = ptr->data; assert(HasUMode(client_p, UMODE_OPER)); /* * If we're sending it to opers and they're an admin, skip. * If we're sending it to admins, and they're not, skip. */ if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) || ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN))) continue; if (HasUMode(client_p, flags)) sendto_one(client_p, ":%s NOTICE %s :*** %s -- %s", me.name, client_p->name, ntype, nbuf); } } /* sendto_wallops_flags() * * inputs - flag types of messages to show to real opers * - client sending request * - var args input message * output - NONE * side effects - Send a wallops to local opers */ void sendto_wallops_flags(unsigned int flags, struct Client *source_p, const char *pattern, ...) { dlink_node *ptr = NULL; va_list args; char buffer[IRCD_BUFSIZE]; int len; if (IsClient(source_p)) len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s WALLOPS :", source_p->name, source_p->username, source_p->host); else len = snprintf(buffer, sizeof(buffer), ":%s WALLOPS :", source_p->name); va_start(args, pattern); len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); va_end(args); DLINK_FOREACH(ptr, oper_list.head) { struct Client *client_p = ptr->data; assert(client_p->umodes & UMODE_OPER); if (HasUMode(client_p, flags) && !IsDefunct(client_p)) send_message(client_p, buffer, len); } } /* ts_warn() * * inputs - var args message * output - NONE * side effects - Call sendto_realops_flags, with some flood checking * (at most 5 warnings every 5 seconds) */ void ts_warn(const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; static time_t last = 0; static int warnings = 0; /* ** if we're running with TS_WARNINGS enabled and someone does ** something silly like (remotely) connecting a nonTS server, ** we'll get a ton of warnings, so we make sure we don't send ** more than 5 every 5 seconds. -orabidoo */ if (CurrentTime - last < 5) { if (++warnings > 5) return; } else { last = CurrentTime; warnings = 0; } va_start(args, pattern); vsnprintf(buffer, sizeof(buffer), pattern, args); va_end(args); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s", buffer); ilog(LOG_TYPE_IRCD, "%s", buffer); } /* kill_client() * * inputs - client to send kill towards * - pointer to client to kill * - reason for kill * output - NONE * side effects - NONE */ void kill_client(struct Client *client_p, struct Client *diedie, const char *pattern, ...) { va_list args; char buffer[IRCD_BUFSIZE]; int len; if (client_p->from != NULL) client_p = client_p->from; if (IsDead(client_p)) return; len = snprintf(buffer, sizeof(buffer), ":%s KILL %s :", ID_or_name(&me, client_p->from), ID_or_name(diedie, client_p)); va_start(args, pattern); len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args); va_end(args); send_message(client_p, buffer, len); } /* kill_client_ll_serv_butone() * * inputs - pointer to client to not send to * - pointer to client to kill * output - NONE * side effects - Send a KILL for the given client * message to all connected servers * except the client 'one'. Also deal with * client being unknown to leaf, as in lazylink... */ void kill_client_serv_butone(struct Client *one, struct Client *source_p, const char *pattern, ...) { va_list args; int have_uid = 0; dlink_node *ptr = NULL; char buf_uid[IRCD_BUFSIZE], buf_nick[IRCD_BUFSIZE]; int len_uid = 0, len_nick = 0; if (HasID(source_p)) { have_uid = 1; va_start(args, pattern); len_uid = snprintf(buf_uid, sizeof(buf_uid), ":%s KILL %s :", me.id, ID(source_p)); len_uid += send_format(&buf_uid[len_uid], IRCD_BUFSIZE - len_uid, pattern, args); va_end(args); } va_start(args, pattern); len_nick = snprintf(buf_nick, sizeof(buf_nick), ":%s KILL %s :", me.name, source_p->name); len_nick += send_format(&buf_nick[len_nick], IRCD_BUFSIZE - len_nick, pattern, args); va_end(args); DLINK_FOREACH(ptr, serv_list.head) { struct Client *client_p = ptr->data; if (one != NULL && (client_p == one->from)) continue; if (IsDefunct(client_p)) continue; if (have_uid && IsCapable(client_p, CAP_TS6)) send_message(client_p, buf_uid, len_uid); else send_message(client_p, buf_nick, len_nick); } } ircd-hybrid-8.1.13.dfsg.1/src/channel_mode.c0000644000175000017500000014475112263053413016567 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * channel_mode.c: Controls modes on channels. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: channel_mode.c 2696 2013-12-18 12:12:12Z michael $ */ #include "stdinc.h" #include "list.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "hash.h" #include "conf.h" #include "hostmask.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "s_serv.h" /* captab */ #include "s_user.h" #include "send.h" #include "whowas.h" #include "event.h" #include "memory.h" #include "mempool.h" #include "log.h" #include "parse.h" /* some small utility functions */ static char *check_string(char *); static char *fix_key(char *); static char *fix_key_old(char *); static void chm_nosuch(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_simple(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_registered(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_limit(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_key(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_op(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); #ifdef HALFOPS static void chm_hop(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); #endif static void chm_voice(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_ban(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_except(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void chm_invex(struct Client *, struct Client *, struct Channel *, int, int *, char **, int *, int, int, char, void *, const char *); static void send_cap_mode_changes(struct Client *, struct Client *, struct Channel *, unsigned int, unsigned int); static void send_mode_changes(struct Client *, struct Client *, struct Channel *, char *); /* 10 is a magic number in hybrid 6 NFI where it comes from -db */ #define BAN_FUDGE 10 #define NCHCAPS (sizeof(channel_capabs)/sizeof(int)) #define NCHCAP_COMBOS (1 << NCHCAPS) static char nuh_mask[MAXPARA][IRCD_BUFSIZE]; /* some buffers for rebuilding channel/nick lists with ,'s */ static char modebuf[IRCD_BUFSIZE]; static char parabuf[MODEBUFLEN]; static struct ChModeChange mode_changes[IRCD_BUFSIZE]; static int mode_count; static int mode_limit; /* number of modes set other than simple */ static int simple_modes_mask; /* bit mask of simple modes already set */ #ifdef HALFOPS static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6, CAP_HOPS }; #else static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 }; #endif static struct ChCapCombo chcap_combos[NCHCAP_COMBOS]; extern mp_pool_t *ban_pool; /* check_string() * * inputs - string to check * output - pointer to modified string * side effects - Fixes a string so that the first white space found * becomes an end of string marker (`\0`). * returns the 'fixed' string or "*" if the string * was NULL length or a NULL pointer. */ static char * check_string(char *s) { char *str = s; static char star[] = "*"; if (EmptyString(str)) return star; for (; *s; ++s) { if (IsSpace(*s)) { *s = '\0'; break; } } return EmptyString(str) ? star : str; } /* * Ban functions to work with mode +b/e/d/I */ /* add the specified ID to the channel.. * -is 8/9/00 */ int add_id(struct Client *client_p, struct Channel *chptr, char *banid, int type) { dlink_list *list = NULL; dlink_node *ban = NULL; size_t len = 0; struct Ban *ban_p = NULL; unsigned int num_mask; char name[NICKLEN + 1]; char user[USERLEN + 1]; char host[HOSTLEN + 1]; struct split_nuh_item nuh; /* dont let local clients overflow the b/e/I lists */ if (MyClient(client_p)) { num_mask = dlink_list_length(&chptr->banlist) + dlink_list_length(&chptr->exceptlist) + dlink_list_length(&chptr->invexlist); if (num_mask >= ConfigChannel.max_bans) { sendto_one(client_p, form_str(ERR_BANLISTFULL), me.name, client_p->name, chptr->chname, banid); return 0; } collapse(banid); } nuh.nuhmask = check_string(banid); nuh.nickptr = name; nuh.userptr = user; nuh.hostptr = host; nuh.nicksize = sizeof(name); nuh.usersize = sizeof(user); nuh.hostsize = sizeof(host); split_nuh(&nuh); /* * Re-assemble a new n!u@h and print it back to banid for sending * the mode to the channel. */ len = sprintf(banid, "%s!%s@%s", name, user, host); switch (type) { case CHFL_BAN: list = &chptr->banlist; clear_ban_cache(chptr); break; case CHFL_EXCEPTION: list = &chptr->exceptlist; clear_ban_cache(chptr); break; case CHFL_INVEX: list = &chptr->invexlist; break; default: assert(0); return 0; } DLINK_FOREACH(ban, list->head) { ban_p = ban->data; if (!irccmp(ban_p->name, name) && !irccmp(ban_p->user, user) && !irccmp(ban_p->host, host)) { return 0; } } ban_p = mp_pool_get(ban_pool); memset(ban_p, 0, sizeof(*ban_p)); ban_p->name = xstrdup(name); ban_p->user = xstrdup(user); ban_p->host = xstrdup(host); ban_p->when = CurrentTime; ban_p->len = len - 2; /* -2 for @ and ! */ ban_p->type = parse_netmask(host, &ban_p->addr, &ban_p->bits); if (IsClient(client_p)) { ban_p->who = MyMalloc(strlen(client_p->name) + strlen(client_p->username) + strlen(client_p->host) + 3); sprintf(ban_p->who, "%s!%s@%s", client_p->name, client_p->username, client_p->host); } else if (IsHidden(client_p) || (IsServer(client_p) && ConfigServerHide.hide_servers)) ban_p->who = xstrdup(me.name); else ban_p->who = xstrdup(client_p->name); dlinkAdd(ban_p, &ban_p->node, list); return 1; } /* * inputs - pointer to channel * - pointer to ban id * - type of ban, i.e. ban, exception, invex * output - 0 for failure, 1 for success * side effects - */ static int del_id(struct Channel *chptr, char *banid, int type) { dlink_list *list; dlink_node *ban; struct Ban *banptr; char name[NICKLEN + 1]; char user[USERLEN + 1]; char host[HOSTLEN + 1]; struct split_nuh_item nuh; if (banid == NULL) return 0; nuh.nuhmask = check_string(banid); nuh.nickptr = name; nuh.userptr = user; nuh.hostptr = host; nuh.nicksize = sizeof(name); nuh.usersize = sizeof(user); nuh.hostsize = sizeof(host); split_nuh(&nuh); /* * Re-assemble a new n!u@h and print it back to banid for sending * the mode to the channel. */ sprintf(banid, "%s!%s@%s", name, user, host); switch (type) { case CHFL_BAN: list = &chptr->banlist; clear_ban_cache(chptr); break; case CHFL_EXCEPTION: list = &chptr->exceptlist; clear_ban_cache(chptr); break; case CHFL_INVEX: list = &chptr->invexlist; break; default: sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "del_id() called with unknown ban type %d!", type); return 0; } DLINK_FOREACH(ban, list->head) { banptr = ban->data; if (!irccmp(name, banptr->name) && !irccmp(user, banptr->user) && !irccmp(host, banptr->host)) { remove_ban(banptr, list); return 1; } } return 0; } const struct mode_letter chan_modes[] = { { MODE_NOCTRL, 'c' }, { MODE_INVITEONLY, 'i' }, { MODE_MODERATED, 'm' }, { MODE_NOPRIVMSGS, 'n' }, { MODE_PRIVATE, 'p' }, { MODE_REGISTERED, 'r' }, { MODE_SECRET, 's' }, { MODE_TOPICLIMIT, 't' }, { MODE_MODREG, 'M' }, { MODE_OPERONLY, 'O' }, { MODE_REGONLY, 'R' }, { MODE_SSLONLY, 'S' }, { 0, '\0' } }; /* channel_modes() * * inputs - pointer to channel * - pointer to client * - pointer to mode buf * - pointer to parameter buf * output - NONE * side effects - write the "simple" list of channel modes for channel * chptr onto buffer mbuf with the parameters in pbuf. */ void channel_modes(struct Channel *chptr, struct Client *client_p, char *mbuf, char *pbuf) { const struct mode_letter *tab = chan_modes; *mbuf++ = '+'; *pbuf = '\0'; for (; tab->mode; ++tab) if (chptr->mode.mode & tab->mode) *mbuf++ = tab->letter; if (chptr->mode.limit) { *mbuf++ = 'l'; if (IsServer(client_p) || HasFlag(client_p, FLAGS_SERVICE) || IsMember(client_p, chptr)) pbuf += sprintf(pbuf, "%d ", chptr->mode.limit); } if (chptr->mode.key[0]) { *mbuf++ = 'k'; if (IsServer(client_p) || HasFlag(client_p, FLAGS_SERVICE) || IsMember(client_p, chptr)) sprintf(pbuf, "%s ", chptr->mode.key); } *mbuf = '\0'; } /* fix_key() * * inputs - pointer to key to clean up * output - pointer to cleaned up key * side effects - input string is modified * * stolen from Undernet's ircd -orabidoo */ static char * fix_key(char *arg) { unsigned char *s, *t, c; for (s = t = (unsigned char *)arg; (c = *s); s++) { c &= 0x7f; if (c != ':' && c > ' ' && c != ',') *t++ = c; } *t = '\0'; return(arg); } /* fix_key_old() * * inputs - pointer to key to clean up * output - pointer to cleaned up key * side effects - input string is modifed * * Here we attempt to be compatible with older non-hybrid servers. * We can't back down from the ':' issue however. --Rodder */ static char * fix_key_old(char *arg) { unsigned char *s, *t, c; for (s = t = (unsigned char *)arg; (c = *s); s++) { c &= 0x7f; if ((c != 0x0a) && (c != ':') && (c != 0x0d) && (c != ',')) *t++ = c; } *t = '\0'; return(arg); } /* bitmasks for various error returns that set_channel_mode should only return * once per call -orabidoo */ #define SM_ERR_NOTS 0x00000001 /* No TS on channel */ #define SM_ERR_NOOPS 0x00000002 /* No chan ops */ #define SM_ERR_UNKNOWN 0x00000004 #define SM_ERR_RPL_B 0x00000008 #define SM_ERR_RPL_E 0x00000010 #define SM_ERR_NOTONCHANNEL 0x00000020 /* Not on channel */ #define SM_ERR_RPL_I 0x00000040 #define SM_ERR_NOTOPER 0x00000080 #define SM_ERR_ONLYSERVER 0x00000100 /* Now lets do some stuff to keep track of what combinations of * servers exist... * Note that the number of combinations doubles each time you add * something to this list. Each one is only quick if no servers use that * combination, but if the numbers get too high here MODE will get too * slow. I suggest if you get more than 7 here, you consider getting rid * of some and merging or something. If it wasn't for irc+cs we would * probably not even need to bother about most of these, but unfortunately * we do. -A1kmm */ /* void init_chcap_usage_counts(void) * * Inputs - none * Output - none * Side-effects - Initialises the usage counts to zero. Fills in the * chcap_yes and chcap_no combination tables. */ void init_chcap_usage_counts(void) { unsigned long m, c, y, n; memset(chcap_combos, 0, sizeof(chcap_combos)); /* For every possible combination */ for (m = 0; m < NCHCAP_COMBOS; m++) { /* Check each capab */ for (c = y = n = 0; c < NCHCAPS; c++) { if ((m & (1 << c)) == 0) n |= channel_capabs[c]; else y |= channel_capabs[c]; } chcap_combos[m].cap_yes = y; chcap_combos[m].cap_no = n; } } /* void set_chcap_usage_counts(struct Client *serv_p) * Input: serv_p; The client whose capabs to register. * Output: none * Side-effects: Increments the usage counts for the correct capab * combination. */ void set_chcap_usage_counts(struct Client *serv_p) { int n; for (n = 0; n < NCHCAP_COMBOS; n++) { if (((serv_p->localClient->caps & chcap_combos[n].cap_yes) == chcap_combos[n].cap_yes) && ((serv_p->localClient->caps & chcap_combos[n].cap_no) == 0)) { chcap_combos[n].count++; return; } } /* This should be impossible -A1kmm. */ assert(0); } /* void set_chcap_usage_counts(struct Client *serv_p) * * Inputs - serv_p; The client whose capabs to register. * Output - none * Side-effects - Decrements the usage counts for the correct capab * combination. */ void unset_chcap_usage_counts(struct Client *serv_p) { int n; for (n = 0; n < NCHCAP_COMBOS; n++) { if ((serv_p->localClient->caps & chcap_combos[n].cap_yes) == chcap_combos[n].cap_yes && (serv_p->localClient->caps & chcap_combos[n].cap_no) == 0) { /* Hopefully capabs can't change dynamically or anything... */ assert(chcap_combos[n].count > 0); chcap_combos[n].count--; return; } } /* This should be impossible -A1kmm. */ assert(0); } /* Mode functions handle mode changes for a particular mode... */ static void chm_nosuch(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { if (*errors & SM_ERR_UNKNOWN) return; *errors |= SM_ERR_UNKNOWN; sendto_one(source_p, form_str(ERR_UNKNOWNMODE), me.name, source_p->name, c); } static void chm_simple(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { long mode_type; mode_type = (long)d; if ((alev < CHACCESS_HALFOP) || ((mode_type == MODE_PRIVATE) && (alev < CHACCESS_CHANOP))) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } /* If have already dealt with this simple mode, ignore it */ if (simple_modes_mask & mode_type) return; simple_modes_mask |= mode_type; /* setting + */ /* Apparently, (though no one has ever told the hybrid group directly) * admins don't like redundant mode checking. ok. It would have been nice * if you had have told us directly. I've left the original code snippets * in place. * * -Dianora */ if (dir == MODE_ADD) /* && !(chptr->mode.mode & mode_type)) */ { chptr->mode.mode |= mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_ADD; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].id = NULL; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count++].arg = NULL; } else if (dir == MODE_DEL) /* && (chptr->mode.mode & mode_type)) */ { /* setting - */ chptr->mode.mode &= ~mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = NULL; } } static void chm_registered(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { long mode_type; mode_type = (long)d; if (!IsServer(source_p) && !HasFlag(source_p, FLAGS_SERVICE)) { if (!(*errors & SM_ERR_ONLYSERVER)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_ONLYSERVERSCANCHANGE), me.name, source_p->name, chname); *errors |= SM_ERR_ONLYSERVER; return; } /* If have already dealt with this simple mode, ignore it */ if (simple_modes_mask & mode_type) return; simple_modes_mask |= mode_type; /* setting + */ /* Apparently, (though no one has ever told the hybrid group directly) * admins don't like redundant mode checking. ok. It would have been nice * if you had have told us directly. I've left the original code snippets * in place. * * -Dianora */ if (dir == MODE_ADD) /* && !(chptr->mode.mode & mode_type)) */ { chptr->mode.mode |= mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_ADD; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].id = NULL; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count++].arg = NULL; } else if (dir == MODE_DEL) /* && (chptr->mode.mode & mode_type)) */ { /* setting - */ chptr->mode.mode &= ~mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = NULL; } } static void chm_operonly(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { long mode_type; mode_type = (long)d; if ((alev < CHACCESS_HALFOP) || ((mode_type == MODE_PRIVATE) && (alev < CHACCESS_CHANOP))) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } else if (MyClient(source_p) && !HasUMode(source_p, UMODE_OPER)) { if (!(*errors & SM_ERR_NOTOPER)) { if (alev == CHACCESS_NOTONCHAN) sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, chname); else sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, source_p->name); } *errors |= SM_ERR_NOTOPER; return; } /* If have already dealt with this simple mode, ignore it */ if (simple_modes_mask & mode_type) return; simple_modes_mask |= mode_type; if (dir == MODE_ADD) /* && !(chptr->mode.mode & mode_type)) */ { chptr->mode.mode |= mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_ADD; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].id = NULL; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count++].arg = NULL; } else if (dir == MODE_DEL) /* && (chptr->mode.mode & mode_type)) */ { /* setting - */ chptr->mode.mode &= ~mode_type; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = NULL; } } static void chm_ban(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *mask = NULL; if (dir == MODE_QUERY || parc <= *parn) { dlink_node *ptr = NULL; if (*errors & SM_ERR_RPL_B) return; *errors |= SM_ERR_RPL_B; DLINK_FOREACH(ptr, chptr->banlist.head) { const struct Ban *banptr = ptr->data; sendto_one(client_p, form_str(RPL_BANLIST), me.name, client_p->name, chname, banptr->name, banptr->user, banptr->host, banptr->who, banptr->when); } sendto_one(source_p, form_str(RPL_ENDOFBANLIST), me.name, source_p->name, chname); return; } if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; mask = nuh_mask[*parn]; memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn])); ++*parn; if (IsServer(client_p)) if (strchr(mask, ' ')) return; switch (dir) { case MODE_ADD: if (!add_id(source_p, chptr, mask, CHFL_BAN)) return; break; case MODE_DEL: if (!del_id(chptr, mask, CHFL_BAN)) return; break; default: assert(0); } mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = mask; } static void chm_except(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *mask = NULL; if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if (dir == MODE_QUERY || parc <= *parn) { dlink_node *ptr = NULL; if (*errors & SM_ERR_RPL_E) return; *errors |= SM_ERR_RPL_E; DLINK_FOREACH(ptr, chptr->exceptlist.head) { const struct Ban *banptr = ptr->data; sendto_one(client_p, form_str(RPL_EXCEPTLIST), me.name, client_p->name, chname, banptr->name, banptr->user, banptr->host, banptr->who, banptr->when); } sendto_one(source_p, form_str(RPL_ENDOFEXCEPTLIST), me.name, source_p->name, chname); return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; mask = nuh_mask[*parn]; memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn])); ++*parn; if (IsServer(client_p)) if (strchr(mask, ' ')) return; switch (dir) { case MODE_ADD: if (!add_id(source_p, chptr, mask, CHFL_EXCEPTION)) return; break; case MODE_DEL: if (!del_id(chptr, mask, CHFL_EXCEPTION)) return; break; default: assert(0); } mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ONLY_CHANOPS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = mask; } static void chm_invex(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *mask = NULL; if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if (dir == MODE_QUERY || parc <= *parn) { dlink_node *ptr = NULL; if (*errors & SM_ERR_RPL_I) return; *errors |= SM_ERR_RPL_I; DLINK_FOREACH(ptr, chptr->invexlist.head) { const struct Ban *banptr = ptr->data; sendto_one(client_p, form_str(RPL_INVITELIST), me.name, client_p->name, chname, banptr->name, banptr->user, banptr->host, banptr->who, banptr->when); } sendto_one(source_p, form_str(RPL_ENDOFINVITELIST), me.name, source_p->name, chname); return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; mask = nuh_mask[*parn]; memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn])); ++*parn; if (IsServer(client_p)) if (strchr(mask, ' ')) return; switch (dir) { case MODE_ADD: if (!add_id(source_p, chptr, mask, CHFL_INVEX)) return; break; case MODE_DEL: if (!del_id(chptr, mask, CHFL_INVEX)) return; break; default: assert(0); } mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ONLY_CHANOPS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = mask; } /* * inputs - pointer to channel * output - none * side effects - clear ban cache */ void clear_ban_cache(struct Channel *chptr) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, chptr->members.head) { struct Membership *ms = ptr->data; if (MyConnect(ms->client_p)) ms->flags &= ~(CHFL_BAN_SILENCED|CHFL_BAN_CHECKED); } } void clear_ban_cache_client(struct Client *client_p) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, client_p->channel.head) { struct Membership *ms = ptr->data; ms->flags &= ~(CHFL_BAN_SILENCED|CHFL_BAN_CHECKED); } } static void chm_op(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *opnick; struct Client *targ_p; struct Membership *member; int caps = 0; if (alev < CHACCESS_CHANOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if ((dir == MODE_QUERY) || (parc <= *parn)) return; opnick = parv[(*parn)++]; if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; if ((member = find_channel_link(targ_p, chptr)) == NULL) { if (!(*errors & SM_ERR_NOTONCHANNEL)) sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), me.name, source_p->name, opnick, chname); *errors |= SM_ERR_NOTONCHANNEL; return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; /* no redundant mode changes */ if (dir == MODE_ADD && has_member_flags(member, CHFL_CHANOP)) return; if (dir == MODE_DEL && !has_member_flags(member, CHFL_CHANOP)) { #ifdef HALFOPS if (has_member_flags(member, CHFL_HALFOP)) { --*parn; chm_hop(client_p, source_p, chptr, parc, parn, parv, errors, alev, dir, c, d, chname); } #endif return; } #ifdef HALFOPS if (dir == MODE_ADD && has_member_flags(member, CHFL_HALFOP)) { /* promoting from % to @ is visible only to CAP_HOPS servers */ mode_changes[mode_count].letter = 'h'; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = caps = CAP_HOPS; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count].arg = targ_p->name; mode_changes[mode_count++].client = targ_p; } #endif mode_changes[mode_count].letter = 'o'; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = caps; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = targ_p->id; mode_changes[mode_count].arg = targ_p->name; mode_changes[mode_count++].client = targ_p; if (dir == MODE_ADD) { AddMemberFlag(member, CHFL_CHANOP); DelMemberFlag(member, CHFL_DEOPPED | CHFL_HALFOP); } else DelMemberFlag(member, CHFL_CHANOP); } #ifdef HALFOPS static void chm_hop(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *opnick; struct Client *targ_p; struct Membership *member; /* *sigh* - dont allow halfops to set +/-h, they could fully control a * channel if there were no ops - it doesnt solve anything.. MODE_PRIVATE * when used with MODE_SECRET is paranoid - cant use +p * * it needs to be optional per channel - but not via +p, that or remove * paranoid.. -- fl_ * * +p means paranoid, it is useless for anything else on modern IRC, as * list isn't really usable. If you want to have a private channel these * days, you set it +s. Halfops can no longer remove simple modes when * +p is set (although they can set +p) so it is safe to use this to * control whether they can (de)halfop... */ if (alev < ((chptr->mode.mode & MODE_PRIVATE) ? CHACCESS_CHANOP : CHACCESS_HALFOP)) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if ((dir == MODE_QUERY) || (parc <= *parn)) return; opnick = parv[(*parn)++]; if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; if ((member = find_channel_link(targ_p, chptr)) == NULL) { if (!(*errors & SM_ERR_NOTONCHANNEL)) sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), me.name, source_p->name, opnick, chname); *errors |= SM_ERR_NOTONCHANNEL; return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; /* no redundant mode changes */ if (dir == MODE_ADD && has_member_flags(member, CHFL_HALFOP | CHFL_CHANOP)) return; if (dir == MODE_DEL && !has_member_flags(member, CHFL_HALFOP)) return; mode_changes[mode_count].letter = 'h'; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = CAP_HOPS; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = targ_p->id; mode_changes[mode_count].arg = targ_p->name; mode_changes[mode_count++].client = targ_p; mode_changes[mode_count].letter = 'o'; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = CAP_HOPS; mode_changes[mode_count].mems = ONLY_SERVERS; mode_changes[mode_count].id = targ_p->id; mode_changes[mode_count].arg = targ_p->name; mode_changes[mode_count++].client = targ_p; if (dir == MODE_ADD) { AddMemberFlag(member, CHFL_HALFOP); DelMemberFlag(member, CHFL_DEOPPED); } else DelMemberFlag(member, CHFL_HALFOP); } #endif static void chm_voice(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { char *opnick; struct Client *targ_p; struct Membership *member; if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if ((dir == MODE_QUERY) || parc <= *parn) return; opnick = parv[(*parn)++]; if ((targ_p = find_chasing(source_p, opnick, NULL)) == NULL) return; if (!IsClient(targ_p)) return; if ((member = find_channel_link(targ_p, chptr)) == NULL) { if (!(*errors & SM_ERR_NOTONCHANNEL)) sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), me.name, source_p->name, opnick, chname); *errors |= SM_ERR_NOTONCHANNEL; return; } if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS)) return; /* no redundant mode changes */ if (dir == MODE_ADD && has_member_flags(member, CHFL_VOICE)) return; if (dir == MODE_DEL && !has_member_flags(member, CHFL_VOICE)) return; mode_changes[mode_count].letter = 'v'; mode_changes[mode_count].dir = dir; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = targ_p->id; mode_changes[mode_count].arg = targ_p->name; mode_changes[mode_count++].client = targ_p; if (dir == MODE_ADD) AddMemberFlag(member, CHFL_VOICE); else DelMemberFlag(member, CHFL_VOICE); } static void chm_limit(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { int i, limit; char *lstr; if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if (dir == MODE_QUERY) return; if ((dir == MODE_ADD) && parc > *parn) { lstr = parv[(*parn)++]; if ((limit = atoi(lstr)) <= 0) return; sprintf(lstr, "%d", limit); /* if somebody sets MODE #channel +ll 1 2, accept latter --fl */ for (i = 0; i < mode_count; i++) { if (mode_changes[i].letter == c && mode_changes[i].dir == MODE_ADD) mode_changes[i].letter = 0; } mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_ADD; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = lstr; chptr->mode.limit = limit; } else if (dir == MODE_DEL) { if (!chptr->mode.limit) return; chptr->mode.limit = 0; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = NULL; } } static void chm_key(struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname) { int i; char *key; if (alev < CHACCESS_HALFOP) { if (!(*errors & SM_ERR_NOOPS)) sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ? ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chname); *errors |= SM_ERR_NOOPS; return; } if (dir == MODE_QUERY) return; if ((dir == MODE_ADD) && parc > *parn) { key = parv[(*parn)++]; if (MyClient(source_p)) fix_key(key); else fix_key_old(key); if (*key == '\0') return; assert(key[0] != ' '); strlcpy(chptr->mode.key, key, sizeof(chptr->mode.key)); /* if somebody does MODE #channel +kk a b, accept latter --fl */ for (i = 0; i < mode_count; i++) { if (mode_changes[i].letter == c && mode_changes[i].dir == MODE_ADD) mode_changes[i].letter = 0; } mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_ADD; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = chptr->mode.key; } else if (dir == MODE_DEL) { if (parc > *parn) (*parn)++; if (chptr->mode.key[0] == '\0') return; chptr->mode.key[0] = '\0'; mode_changes[mode_count].letter = c; mode_changes[mode_count].dir = MODE_DEL; mode_changes[mode_count].caps = 0; mode_changes[mode_count].nocaps = 0; mode_changes[mode_count].mems = ALL_MEMBERS; mode_changes[mode_count].id = NULL; mode_changes[mode_count++].arg = "*"; } } struct ChannelMode { void (*func) (struct Client *client_p, struct Client *source_p, struct Channel *chptr, int parc, int *parn, char **parv, int *errors, int alev, int dir, char c, void *d, const char *chname); void *d; }; static struct ChannelMode ModeTable[255] = { {chm_nosuch, NULL}, {chm_nosuch, NULL}, /* A */ {chm_nosuch, NULL}, /* B */ {chm_nosuch, NULL}, /* C */ {chm_nosuch, NULL}, /* D */ {chm_nosuch, NULL}, /* E */ {chm_nosuch, NULL}, /* F */ {chm_nosuch, NULL}, /* G */ {chm_nosuch, NULL}, /* H */ {chm_invex, NULL}, /* I */ {chm_nosuch, NULL}, /* J */ {chm_nosuch, NULL}, /* K */ {chm_nosuch, NULL}, /* L */ {chm_simple, (void *)MODE_MODREG}, /* M */ {chm_nosuch, NULL}, /* N */ {chm_operonly, (void *) MODE_OPERONLY}, /* O */ {chm_nosuch, NULL}, /* P */ {chm_nosuch, NULL}, /* Q */ {chm_simple, (void *) MODE_REGONLY}, /* R */ {chm_simple, (void *) MODE_SSLONLY}, /* S */ {chm_nosuch, NULL}, /* T */ {chm_nosuch, NULL}, /* U */ {chm_nosuch, NULL}, /* V */ {chm_nosuch, NULL}, /* W */ {chm_nosuch, NULL}, /* X */ {chm_nosuch, NULL}, /* Y */ {chm_nosuch, NULL}, /* Z */ {chm_nosuch, NULL}, {chm_nosuch, NULL}, {chm_nosuch, NULL}, {chm_nosuch, NULL}, {chm_nosuch, NULL}, {chm_nosuch, NULL}, {chm_nosuch, NULL}, /* a */ {chm_ban, NULL}, /* b */ {chm_simple, (void *) MODE_NOCTRL}, /* c */ {chm_nosuch, NULL}, /* d */ {chm_except, NULL}, /* e */ {chm_nosuch, NULL}, /* f */ {chm_nosuch, NULL}, /* g */ #ifdef HALFOPS {chm_hop, NULL}, /* h */ #else {chm_nosuch, NULL}, /* h */ #endif {chm_simple, (void *) MODE_INVITEONLY}, /* i */ {chm_nosuch, NULL}, /* j */ {chm_key, NULL}, /* k */ {chm_limit, NULL}, /* l */ {chm_simple, (void *) MODE_MODERATED}, /* m */ {chm_simple, (void *) MODE_NOPRIVMSGS}, /* n */ {chm_op, NULL}, /* o */ {chm_simple, (void *) MODE_PRIVATE}, /* p */ {chm_nosuch, NULL}, /* q */ {chm_registered, (void *) MODE_REGISTERED}, /* r */ {chm_simple, (void *) MODE_SECRET}, /* s */ {chm_simple, (void *) MODE_TOPICLIMIT}, /* t */ {chm_nosuch, NULL}, /* u */ {chm_voice, NULL}, /* v */ {chm_nosuch, NULL}, /* w */ {chm_nosuch, NULL}, /* x */ {chm_nosuch, NULL}, /* y */ {chm_nosuch, NULL}, /* z */ }; /* get_channel_access() * * inputs - pointer to Client struct * - pointer to Membership struct * output - CHACCESS_CHANOP if we should let them have * chanop level access, 0 for peon level access. * side effects - NONE */ static int get_channel_access(struct Client *source_p, struct Membership *member) { /* Let hacked servers in for now... */ if (!MyClient(source_p)) return CHACCESS_CHANOP; if (member == NULL) return CHACCESS_NOTONCHAN; /* just to be sure.. */ assert(source_p == member->client_p); if (has_member_flags(member, CHFL_CHANOP)) return CHACCESS_CHANOP; #ifdef HALFOPS if (has_member_flags(member, CHFL_HALFOP)) return CHACCESS_HALFOP; #endif return CHACCESS_PEON; } /* void send_cap_mode_changes(struct Client *client_p, * struct Client *source_p, * struct Channel *chptr, int cap, int nocap) * Input: The client sending(client_p), the source client(source_p), * the channel to send mode changes for(chptr) * Output: None. * Side-effects: Sends the appropriate mode changes to capable servers. * * send_cap_mode_changes() will loop the server list itself, because * at this point in time we have 4 capabs for channels, CAP_IE, CAP_EX, * and a server could support any number of these.. * so we make the modebufs per server, tailoring them to each servers * specific demand. Its not very pretty, but its one of the few realistic * ways to handle having this many capabs for channel modes.. --fl_ * * Reverted back to my original design, except that we now keep a count * of the number of servers which each combination as an optimisation, so * the capabs combinations which are not needed are not worked out. -A1kmm */ /* rewritten to ensure parabuf < MODEBUFLEN -db */ static void send_cap_mode_changes(struct Client *client_p, struct Client *source_p, struct Channel *chptr, unsigned int cap, unsigned int nocap) { int i, mbl, pbl, arglen, nc, mc; int len; const char *arg = NULL; char *parptr; int dir = MODE_QUERY; mc = 0; nc = 0; pbl = 0; parabuf[0] = '\0'; parptr = parabuf; if ((cap & CAP_TS6) && source_p->id[0] != '\0') mbl = sprintf(modebuf, ":%s TMODE %lu %s ", source_p->id, (unsigned long)chptr->channelts, chptr->chname); else mbl = sprintf(modebuf, ":%s MODE %s ", source_p->name, chptr->chname); /* loop the list of - modes we have */ for (i = 0; i < mode_count; i++) { /* if they dont support the cap we need, or they do support a cap they * cant have, then dont add it to the modebuf.. that way they wont see * the mode */ if ((mode_changes[i].letter == 0) || ((cap & mode_changes[i].caps) != mode_changes[i].caps) || ((nocap & mode_changes[i].nocaps) != mode_changes[i].nocaps)) continue; arg = ""; if ((cap & CAP_TS6) && mode_changes[i].id) arg = mode_changes[i].id; if (*arg == '\0') arg = mode_changes[i].arg; /* if we're creeping past the buf size, we need to send it and make * another line for the other modes * XXX - this could give away server topology with uids being * different lengths, but not much we can do, except possibly break * them as if they were the longest of the nick or uid at all times, * which even then won't work as we don't always know the uid -A1kmm. */ if (arg != NULL) arglen = strlen(arg); else arglen = 0; if ((mc == MAXMODEPARAMS) || ((arglen + mbl + pbl + 2) > IRCD_BUFSIZE) || (pbl + arglen + BAN_FUDGE) >= MODEBUFLEN) { if (nc != 0) sendto_server(client_p, cap, nocap, "%s %s", modebuf, parabuf); nc = 0; mc = 0; if ((cap & CAP_TS6) && source_p->id[0] != '\0') mbl = sprintf(modebuf, ":%s MODE %s ", source_p->id, chptr->chname); else mbl = sprintf(modebuf, ":%s MODE %s ", source_p->name, chptr->chname); pbl = 0; parabuf[0] = '\0'; parptr = parabuf; dir = MODE_QUERY; } if (dir != mode_changes[i].dir) { modebuf[mbl++] = (mode_changes[i].dir == MODE_ADD) ? '+' : '-'; dir = mode_changes[i].dir; } modebuf[mbl++] = mode_changes[i].letter; modebuf[mbl] = '\0'; nc++; if (arg != NULL) { len = sprintf(parptr, "%s ", arg); pbl += len; parptr += len; mc++; } } if (pbl && parabuf[pbl - 1] == ' ') parabuf[pbl - 1] = 0; if (nc != 0) sendto_server(client_p, cap, nocap, "%s %s", modebuf, parabuf); } /* void send_mode_changes(struct Client *client_p, * struct Client *source_p, * struct Channel *chptr) * Input: The client sending(client_p), the source client(source_p), * the channel to send mode changes for(chptr), * mode change globals. * Output: None. * Side-effects: Sends the appropriate mode changes to other clients * and propagates to servers. */ /* ensure parabuf < MODEBUFLEN -db */ static void send_mode_changes(struct Client *client_p, struct Client *source_p, struct Channel *chptr, char *chname) { int i, mbl, pbl, arglen, nc, mc; int len; const char *arg = NULL; char *parptr; int dir = MODE_QUERY; /* bail out if we have nothing to do... */ if (!mode_count) return; if (IsServer(source_p)) mbl = sprintf(modebuf, ":%s MODE %s ", (IsHidden(source_p) || ConfigServerHide.hide_servers) ? me.name : source_p->name, chname); else mbl = sprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name, source_p->username, source_p->host, chname); mc = 0; nc = 0; pbl = 0; parabuf[0] = '\0'; parptr = parabuf; for (i = 0; i < mode_count; i++) { if (mode_changes[i].letter == 0 || mode_changes[i].mems == NON_CHANOPS || mode_changes[i].mems == ONLY_SERVERS) continue; arg = mode_changes[i].arg; if (arg != NULL) arglen = strlen(arg); else arglen = 0; if ((mc == MAXMODEPARAMS) || ((arglen + mbl + pbl + 2) > IRCD_BUFSIZE) || ((arglen + pbl + BAN_FUDGE) >= MODEBUFLEN)) { if (mbl && modebuf[mbl - 1] == '-') modebuf[mbl - 1] = '\0'; if (nc != 0) sendto_channel_local(ALL_MEMBERS, 0, chptr, "%s %s", modebuf, parabuf); nc = 0; mc = 0; if (IsServer(source_p)) mbl = sprintf(modebuf, ":%s MODE %s ", (IsHidden(source_p) || ConfigServerHide.hide_servers) ? me.name : source_p->name, chname); else mbl = sprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name, source_p->username, source_p->host, chname); pbl = 0; parabuf[0] = '\0'; parptr = parabuf; dir = MODE_QUERY; } if (dir != mode_changes[i].dir) { modebuf[mbl++] = (mode_changes[i].dir == MODE_ADD) ? '+' : '-'; dir = mode_changes[i].dir; } modebuf[mbl++] = mode_changes[i].letter; modebuf[mbl] = '\0'; nc++; if (arg != NULL) { len = sprintf(parptr, "%s ", arg); pbl += len; parptr += len; mc++; } } if (pbl && parabuf[pbl - 1] == ' ') parabuf[pbl - 1] = 0; if (nc != 0) sendto_channel_local(ALL_MEMBERS, 0, chptr, "%s %s", modebuf, parabuf); nc = 0; mc = 0; /* Now send to servers... */ for (i = 0; i < NCHCAP_COMBOS; i++) if (chcap_combos[i].count != 0) send_cap_mode_changes(client_p, source_p, chptr, chcap_combos[i].cap_yes, chcap_combos[i].cap_no); } /* void set_channel_mode(struct Client *client_p, struct Client *source_p, * struct Channel *chptr, int parc, char **parv, * char *chname) * Input: The client we received this from, the client this originated * from, the channel, the parameter count starting at the modes, * the parameters, the channel name. * Output: None. * Side-effects: Changes the channel membership and modes appropriately, * sends the appropriate MODE messages to the appropriate * clients. */ void set_channel_mode(struct Client *client_p, struct Client *source_p, struct Channel *chptr, struct Membership *member, int parc, char *parv[], char *chname) { int dir = MODE_ADD; int parn = 1; int alevel, errors = 0; char *ml = parv[0], c; int table_position; mode_count = 0; mode_limit = 0; simple_modes_mask = 0; alevel = get_channel_access(source_p, member); for (; (c = *ml) != '\0'; ml++) { switch (c) { case '+': dir = MODE_ADD; break; case '-': dir = MODE_DEL; break; case '=': dir = MODE_QUERY; break; default: if (c < 'A' || c > 'z') table_position = 0; else table_position = c - 'A' + 1; ModeTable[table_position].func(client_p, source_p, chptr, parc, &parn, parv, &errors, alevel, dir, c, ModeTable[table_position].d, chname); break; } } send_mode_changes(client_p, source_p, chptr, chname); } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd.c0000644000175000017500000005275512263053413015247 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd.c: Network functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd.c 2734 2014-01-03 17:30:27Z michael $ */ #include "stdinc.h" #include #include #include #include "list.h" #include "fdlist.h" #include "s_bsd.h" #include "client.h" #include "dbuf.h" #include "event.h" #include "irc_string.h" #include "ircd.h" #include "listener.h" #include "numeric.h" #include "packet.h" #include "irc_res.h" #include "restart.h" #include "s_auth.h" #include "conf.h" #include "log.h" #include "s_serv.h" #include "send.h" #include "memory.h" #include "s_user.h" #include "hook.h" static const char *comm_err_str[] = { "Comm OK", "Error during bind()", "Error during DNS lookup", "connect timeout", "Error during connect()", "Comm Error" }; static void comm_connect_callback(fde_t *, int); static PF comm_connect_timeout; static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *); static PF comm_connect_tryconnect; /* check_can_use_v6() * Check if the system can open AF_INET6 sockets */ void check_can_use_v6(void) { #ifdef IPV6 int v6; if ((v6 = socket(AF_INET6, SOCK_STREAM, 0)) < 0) ServerInfo.can_use_v6 = 0; else { ServerInfo.can_use_v6 = 1; close(v6); } #else ServerInfo.can_use_v6 = 0; #endif } /* get_sockerr - get the error value from the socket or the current errno * * Get the *real* error from the socket (well try to anyway..). * This may only work when SO_DEBUG is enabled but its worth the * gamble anyway. */ int get_sockerr(int fd) { int errtmp = errno; #ifdef SO_ERROR int err = 0; socklen_t len = sizeof(err); if (-1 < fd && !getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len)) { if (err) errtmp = err; } errno = errtmp; #endif return errtmp; } /* * report_error - report an error from an errno. * Record error to log and also send a copy to all *LOCAL* opers online. * * text is a *format* string for outputing error. It must * contain only two '%s', the first will be replaced * by the sockhost from the client_p, and the latter will * be taken from sys_errlist[errno]. * * client_p if not NULL, is the *LOCAL* client associated with * the error. * * Cannot use perror() within daemon. stderr is closed in * ircd and cannot be used. And, worse yet, it might have * been reassigned to a normal connection... * * Actually stderr is still there IFF ircd was run with -s --Rodder */ void report_error(int level, const char* text, const char* who, int error) { who = (who) ? who : ""; sendto_realops_flags(UMODE_DEBUG, level, SEND_NOTICE, text, who, strerror(error)); ilog(LOG_TYPE_IRCD, text, who, strerror(error)); } /* * setup_socket() * * Set the socket non-blocking, and other wonderful bits. */ static void setup_socket(int fd) { int opt = 1; setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); #ifdef IPTOS_LOWDELAY opt = IPTOS_LOWDELAY; setsockopt(fd, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)); #endif fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); } /* * close_connection * Close the physical connection. This function must make * MyConnect(client_p) == FALSE, and set client_p->from == NULL. */ void close_connection(struct Client *client_p) { dlink_node *ptr = NULL; assert(client_p); if (!IsDead(client_p)) { /* attempt to flush any pending dbufs. Evil, but .. -- adrian */ /* there is still a chance that we might send data to this socket * even if it is marked as blocked (COMM_SELECT_READ handler is called * before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx */ ClearSendqBlocked(client_p); send_queued_write(client_p); } if (IsClient(client_p)) { ++ServerStats.is_cl; ServerStats.is_cbs += client_p->localClient->send.bytes; ServerStats.is_cbr += client_p->localClient->recv.bytes; ServerStats.is_cti += CurrentTime - client_p->localClient->firsttime; } else if (IsServer(client_p)) { ++ServerStats.is_sv; ServerStats.is_sbs += client_p->localClient->send.bytes; ServerStats.is_sbr += client_p->localClient->recv.bytes; ServerStats.is_sti += CurrentTime - client_p->localClient->firsttime; DLINK_FOREACH(ptr, server_items.head) { struct MaskItem *conf = ptr->data; if (irccmp(conf->name, client_p->name)) continue; /* * Reset next-connect cycle of all connect{} blocks that match * this servername. */ conf->until = CurrentTime + conf->class->con_freq; } } else ++ServerStats.is_ni; #ifdef HAVE_LIBCRYPTO if (client_p->localClient->fd.ssl) { SSL_set_shutdown(client_p->localClient->fd.ssl, SSL_RECEIVED_SHUTDOWN); if (!SSL_shutdown(client_p->localClient->fd.ssl)) SSL_shutdown(client_p->localClient->fd.ssl); } #endif if (client_p->localClient->fd.flags.open) fd_close(&client_p->localClient->fd); dbuf_clear(&client_p->localClient->buf_sendq); dbuf_clear(&client_p->localClient->buf_recvq); MyFree(client_p->localClient->passwd); detach_conf(client_p, CONF_CLIENT|CONF_OPER|CONF_SERVER); client_p->from = NULL; /* ...this should catch them! >:) --msa */ } #ifdef HAVE_LIBCRYPTO /* * ssl_handshake - let OpenSSL initialize the protocol. Register for * read/write events if necessary. */ static void ssl_handshake(int fd, struct Client *client_p) { X509 *cert = NULL; int ret = 0; if ((ret = SSL_accept(client_p->localClient->fd.ssl)) <= 0) { if ((CurrentTime - client_p->localClient->firsttime) > 30) { exit_client(client_p, client_p, "Timeout during SSL handshake"); return; } switch (SSL_get_error(client_p->localClient->fd.ssl, ret)) { case SSL_ERROR_WANT_WRITE: comm_setselect(&client_p->localClient->fd, COMM_SELECT_WRITE, (PF *) ssl_handshake, client_p, 30); return; case SSL_ERROR_WANT_READ: comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ, (PF *) ssl_handshake, client_p, 30); return; default: exit_client(client_p, client_p, "Error during SSL handshake"); return; } } comm_settimeout(&client_p->localClient->fd, 0, NULL, NULL); if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl))) { int res = SSL_get_verify_result(client_p->localClient->fd.ssl); char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' }; unsigned char md[EVP_MAX_MD_SIZE] = { '\0' }; if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN || res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE || res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) { unsigned int i = 0, n = 0; if (X509_digest(cert, EVP_sha256(), md, &n)) { for (; i < n; ++i) snprintf(buf + 2 * i, 3, "%02X", md[i]); client_p->certfp = xstrdup(buf); } } else ilog(LOG_TYPE_IRCD, "Client %s!%s@%s gave bad SSL client certificate: %d", client_p->name, client_p->username, client_p->host, res); X509_free(cert); } start_auth(client_p); } #endif /* * add_connection - creates a client which has just connected to us on * the given fd. The sockhost field is initialized with the ip# of the host. * An unique id is calculated now, in case it is needed for auth. * The client is sent to the auth module for verification, and not put in * any client list yet. */ void add_connection(struct Listener *listener, struct irc_ssaddr *irn, int fd) { struct Client *new_client = make_client(NULL); fd_open(&new_client->localClient->fd, fd, 1, (listener->flags & LISTENER_SSL) ? "Incoming SSL connection" : "Incoming connection"); /* * copy address to 'sockhost' as a string, copy it to host too * so we have something valid to put into error messages... */ memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr)); getnameinfo((struct sockaddr *)&new_client->localClient->ip, new_client->localClient->ip.ss_len, new_client->sockhost, sizeof(new_client->sockhost), NULL, 0, NI_NUMERICHOST); new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family; #ifdef HAVE_LIBGEOIP /* XXX IPV6 SUPPORT XXX */ if (irn->ss.ss_family == AF_INET && geoip_ctx) { const struct sockaddr_in *v4 = (const struct sockaddr_in *)&new_client->localClient->ip; new_client->localClient->country_id = GeoIP_id_by_ipnum(geoip_ctx, (unsigned long)ntohl(v4->sin_addr.s_addr)); } #endif if (new_client->sockhost[0] == ':' && new_client->sockhost[1] == ':') { strlcpy(new_client->host, "0", sizeof(new_client->host)); strlcpy(new_client->host+1, new_client->sockhost, sizeof(new_client->host)-1); memmove(new_client->sockhost+1, new_client->sockhost, sizeof(new_client->sockhost)-1); new_client->sockhost[0] = '0'; } else strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host)); new_client->localClient->listener = listener; ++listener->ref_count; #ifdef HAVE_LIBCRYPTO if (listener->flags & LISTENER_SSL) { if ((new_client->localClient->fd.ssl = SSL_new(ServerInfo.server_ctx)) == NULL) { ilog(LOG_TYPE_IRCD, "SSL_new() ERROR! -- %s", ERR_error_string(ERR_get_error(), NULL)); SetDead(new_client); exit_client(new_client, new_client, "SSL_new failed"); return; } AddFlag(new_client, FLAGS_SSL); SSL_set_fd(new_client->localClient->fd.ssl, fd); ssl_handshake(0, new_client); } else #endif start_auth(new_client); } /* * stolen from squid - its a neat (but overused! :) routine which we * can use to see whether we can ignore this errno or not. It is * generally useful for non-blocking network IO related errnos. * -- adrian */ int ignoreErrno(int ierrno) { switch (ierrno) { case EINPROGRESS: case EWOULDBLOCK: #if EAGAIN != EWOULDBLOCK case EAGAIN: #endif case EALREADY: case EINTR: #ifdef ERESTART case ERESTART: #endif return 1; default: return 0; } } /* * comm_settimeout() - set the socket timeout * * Set the timeout for the fd */ void comm_settimeout(fde_t *fd, time_t timeout, PF *callback, void *cbdata) { assert(fd->flags.open); fd->timeout = CurrentTime + (timeout / 1000); fd->timeout_handler = callback; fd->timeout_data = cbdata; } /* * comm_setflush() - set a flush function * * A flush function is simply a function called if found during * comm_timeouts(). Its basically a second timeout, except in this case * I'm too lazy to implement multiple timeout functions! :-) * its kinda nice to have it separate, since this is designed for * flush functions, and when comm_close() is implemented correctly * with close functions, we _actually_ don't call comm_close() here .. * -- originally Adrian's notes * comm_close() is replaced with fd_close() in fdlist.c */ void comm_setflush(fde_t *fd, time_t timeout, PF *callback, void *cbdata) { assert(fd->flags.open); fd->flush_timeout = CurrentTime + (timeout / 1000); fd->flush_handler = callback; fd->flush_data = cbdata; } /* * comm_checktimeouts() - check the socket timeouts * * All this routine does is call the given callback/cbdata, without closing * down the file descriptor. When close handlers have been implemented, * this will happen. */ void comm_checktimeouts(void *notused) { int i; fde_t *F; PF *hdl; void *data; for (i = 0; i < FD_HASH_SIZE; i++) for (F = fd_hash[i]; F != NULL; F = fd_next_in_loop) { assert(F->flags.open); fd_next_in_loop = F->hnext; /* check flush functions */ if (F->flush_handler && F->flush_timeout > 0 && F->flush_timeout < CurrentTime) { hdl = F->flush_handler; data = F->flush_data; comm_setflush(F, 0, NULL, NULL); hdl(F, data); } /* check timeouts */ if (F->timeout_handler && F->timeout > 0 && F->timeout < CurrentTime) { /* Call timeout handler */ hdl = F->timeout_handler; data = F->timeout_data; comm_settimeout(F, 0, NULL, NULL); hdl(F, data); } } } /* * void comm_connect_tcp(int fd, const char *host, unsigned short port, * struct sockaddr *clocal, int socklen, * CNCB *callback, void *data, int aftype, int timeout) * Input: An fd to connect with, a host and port to connect to, * a local sockaddr to connect from + length(or NULL to use the * default), a callback, the data to pass into the callback, the * address family. * Output: None. * Side-effects: A non-blocking connection to the host is started, and * if necessary, set up for selection. The callback given * may be called now, or it may be called later. */ void comm_connect_tcp(fde_t *fd, const char *host, unsigned short port, struct sockaddr *clocal, int socklen, CNCB *callback, void *data, int aftype, int timeout) { struct addrinfo hints, *res; char portname[PORTNAMELEN + 1]; assert(callback); fd->connect.callback = callback; fd->connect.data = data; fd->connect.hostaddr.ss.ss_family = aftype; fd->connect.hostaddr.ss_port = htons(port); /* Note that we're using a passed sockaddr here. This is because * generally you'll be bind()ing to a sockaddr grabbed from * getsockname(), so this makes things easier. * XXX If NULL is passed as local, we should later on bind() to the * virtual host IP, for completeness. * -- adrian */ if ((clocal != NULL) && (bind(fd->fd, clocal, socklen) < 0)) { /* Failure, call the callback with COMM_ERR_BIND */ comm_connect_callback(fd, COMM_ERR_BIND); /* ... and quit */ return; } /* Next, if we have been given an IP, get the addr and skip the * DNS check (and head direct to comm_connect_tryconnect(). */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; snprintf(portname, sizeof(portname), "%d", port); if (getaddrinfo(host, portname, &hints, &res)) { /* Send the DNS request, for the next level */ if (aftype == AF_INET6) gethost_byname_type(comm_connect_dns_callback, fd, host, T_AAAA); else gethost_byname_type(comm_connect_dns_callback, fd, host, T_A); } else { /* We have a valid IP, so we just call tryconnect */ /* Make sure we actually set the timeout here .. */ assert(res != NULL); memcpy(&fd->connect.hostaddr, res->ai_addr, res->ai_addrlen); fd->connect.hostaddr.ss_len = res->ai_addrlen; fd->connect.hostaddr.ss.ss_family = res->ai_family; freeaddrinfo(res); comm_settimeout(fd, timeout*1000, comm_connect_timeout, NULL); comm_connect_tryconnect(fd, NULL); } } /* * comm_connect_callback() - call the callback, and continue with life */ static void comm_connect_callback(fde_t *fd, int status) { CNCB *hdl; /* This check is gross..but probably necessary */ if (fd->connect.callback == NULL) return; /* Clear the connect flag + handler */ hdl = fd->connect.callback; fd->connect.callback = NULL; /* Clear the timeout handler */ comm_settimeout(fd, 0, NULL, NULL); /* Call the handler */ hdl(fd, status, fd->connect.data); } /* * comm_connect_timeout() - this gets called when the socket connection * times out. This *only* can be called once connect() is initially * called .. */ static void comm_connect_timeout(fde_t *fd, void *notused) { /* error! */ comm_connect_callback(fd, COMM_ERR_TIMEOUT); } /* * comm_connect_dns_callback() - called at the completion of the DNS request * * The DNS request has completed, so if we've got an error, return it, * otherwise we initiate the connect() */ static void comm_connect_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) { fde_t *F = vptr; if (name == NULL) { comm_connect_callback(F, COMM_ERR_DNS); return; } /* No error, set a 10 second timeout */ comm_settimeout(F, 30*1000, comm_connect_timeout, NULL); /* Copy over the DNS reply info so we can use it in the connect() */ /* * Note we don't fudge the refcount here, because we aren't keeping * the DNS record around, and the DNS cache is gone anyway.. * -- adrian */ memcpy(&F->connect.hostaddr, addr, addr->ss_len); /* The cast is hacky, but safe - port offset is same on v4 and v6 */ ((struct sockaddr_in *) &F->connect.hostaddr)->sin_port = F->connect.hostaddr.ss_port; F->connect.hostaddr.ss_len = addr->ss_len; /* Now, call the tryconnect() routine to try a connect() */ comm_connect_tryconnect(F, NULL); } /* static void comm_connect_tryconnect(int fd, void *notused) * Input: The fd, the handler data(unused). * Output: None. * Side-effects: Try and connect with pending connect data for the FD. If * we succeed or get a fatal error, call the callback. * Otherwise, it is still blocking or something, so register * to select for a write event on this FD. */ static void comm_connect_tryconnect(fde_t *fd, void *notused) { int retval; /* This check is needed or re-entrant s_bsd_* like sigio break it. */ if (fd->connect.callback == NULL) return; /* Try the connect() */ retval = connect(fd->fd, (struct sockaddr *) &fd->connect.hostaddr, fd->connect.hostaddr.ss_len); /* Error? */ if (retval < 0) { /* * If we get EISCONN, then we've already connect()ed the socket, * which is a good thing. * -- adrian */ if (errno == EISCONN) comm_connect_callback(fd, COMM_OK); else if (ignoreErrno(errno)) /* Ignore error? Reschedule */ comm_setselect(fd, COMM_SELECT_WRITE, comm_connect_tryconnect, NULL, 0); else /* Error? Fail with COMM_ERR_CONNECT */ comm_connect_callback(fd, COMM_ERR_CONNECT); return; } /* If we get here, we've suceeded, so call with COMM_OK */ comm_connect_callback(fd, COMM_OK); } /* * comm_errorstr() - return an error string for the given error condition */ const char * comm_errstr(int error) { if (error < 0 || error >= COMM_ERR_MAX) return "Invalid error number!"; return comm_err_str[error]; } /* * comm_open() - open a socket * * This is a highly highly cut down version of squid's comm_open() which * for the most part emulates socket(), *EXCEPT* it fails if we're about * to run out of file descriptors. */ int comm_open(fde_t *F, int family, int sock_type, int proto, const char *note) { int fd; /* First, make sure we aren't going to run out of file descriptors */ if (number_fd >= hard_fdlimit) { errno = ENFILE; return -1; } /* * Next, we try to open the socket. We *should* drop the reserved FD * limit if/when we get an error, but we can deal with that later. * XXX !!! -- adrian */ fd = socket(family, sock_type, proto); if (fd < 0) return -1; /* errno will be passed through, yay.. */ setup_socket(fd); /* update things in our fd tracking */ fd_open(F, fd, 1, note); return 0; } /* * comm_accept() - accept an incoming connection * * This is a simple wrapper for accept() which enforces FD limits like * comm_open() does. Returned fd must be either closed or tagged with * fd_open (this function no longer does it). */ int comm_accept(struct Listener *lptr, struct irc_ssaddr *pn) { int newfd; socklen_t addrlen = sizeof(struct irc_ssaddr); if (number_fd >= hard_fdlimit) { errno = ENFILE; return -1; } /* * Next, do the accept(). if we get an error, we should drop the * reserved fd limit, but we can deal with that when comm_open() * also does it. XXX -- adrian */ newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, &addrlen); if (newfd < 0) return -1; #ifdef IPV6 remove_ipv6_mapping(pn); #else pn->ss_len = addrlen; #endif setup_socket(newfd); /* .. and return */ return newfd; } /* * remove_ipv6_mapping() - Removes IPv4-In-IPv6 mapping from an address * OSes with IPv6 mapping listening on both * AF_INET and AF_INET6 map AF_INET connections inside AF_INET6 structures * */ #ifdef IPV6 void remove_ipv6_mapping(struct irc_ssaddr *addr) { if (addr->ss.ss_family == AF_INET6) { if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)addr)->sin6_addr)) { struct sockaddr_in6 v6; struct sockaddr_in *v4 = (struct sockaddr_in *)addr; memcpy(&v6, addr, sizeof(v6)); memset(v4, 0, sizeof(struct sockaddr_in)); memcpy(&v4->sin_addr, &v6.sin6_addr.s6_addr[12], sizeof(v4->sin_addr)); addr->ss.ss_family = AF_INET; addr->ss_len = sizeof(struct sockaddr_in); } else addr->ss_len = sizeof(struct sockaddr_in6); } else addr->ss_len = sizeof(struct sockaddr_in); } #endif ircd-hybrid-8.1.13.dfsg.1/src/hook.c0000644000175000017500000001335012263053413015101 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2003 Piotr Nizynski, Advanced IRC Services Project Team * Copyright (C) 2005-2013 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hook.c 2693 2013-12-17 19:35:26Z michael $ */ /*! \file hook.c * \brief Provides a generic event hooking interface. * \version $Id: hook.c 2693 2013-12-17 19:35:26Z michael $ */ #include "stdinc.h" #include "list.h" #include "hook.h" #include "ircd.h" #include "memory.h" #include "numeric.h" #include "irc_string.h" #include "send.h" #include "client.h" static dlink_list callback_list; /*! \brief Creates a new callback. * \param name name used to identify the callback * (can be NULL for anonymous callbacks) * \param func initial function attached to the chain * (can be NULL to create an empty chain) * \return pointer to Callback structure or NULL if already exists * \note Once registered, a callback should never be freed! * That's because there may be modules which depend on it * (even if no functions are attached). That's also why * we dynamically allocate the struct here -- we don't want * to allow anyone to place it in module data, which can be * unloaded at any time. */ struct Callback * register_callback(const char *name, CBFUNC *func) { struct Callback *cb = NULL; if (name != NULL) { if ((cb = find_callback(name)) != NULL) { if (func != NULL) dlinkAddTail(func, MyMalloc(sizeof(dlink_node)), &cb->chain); return cb; } } cb = MyMalloc(sizeof(struct Callback)); if (func != NULL) dlinkAdd(func, MyMalloc(sizeof(dlink_node)), &cb->chain); if (name != NULL) { cb->name = xstrdup(name); dlinkAdd(cb, &cb->node, &callback_list); } return cb; } /*! \brief Passes control down the callback hook chain. * \param cb pointer to Callback structure * \param ... argument to pass * \return function return value */ void * execute_callback(struct Callback *cb, ...) { void *res = NULL; va_list args; cb->called++; cb->last = CurrentTime; if (!is_callback_present(cb)) return NULL; va_start(args, cb); res = ((CBFUNC *)cb->chain.head->data)(args); va_end(args); return res; } /*! \brief Called by a hook function to pass code flow further * in the hook chain. * \param this_hook pointer to dlink_node of the current hook function * \param ... (original or modified) arguments to be passed * \return callback return value */ void * pass_callback(dlink_node *this_hook, ...) { void *res = NULL; va_list args; if (this_hook->next == NULL) return NULL; /* reached the last one */ va_start(args, this_hook); res = ((CBFUNC *)this_hook->next->data)(args); va_end(args); return res; } /*! \brief Finds a named callback. * \param name name of the callback * \return pointer to Callback structure or NULL if not found */ struct Callback * find_callback(const char *name) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, callback_list.head) { struct Callback *cb = ptr->data; if (!irccmp(cb->name, name)) return cb; } return NULL; } /*! \brief Installs a hook for the given callback. * * The new hook is installed at the beginning of the chain, * so it has full control over functions installed earlier. * * \param cb pointer to Callback structure * \param hook address of hook function * \return pointer to dlink_node of the hook (used when passing * control to the next hook in the chain); * valid till uninstall_hook() is called */ dlink_node * install_hook(struct Callback *cb, CBFUNC *hook) { dlink_node *node = MyMalloc(sizeof(dlink_node)); dlinkAdd(hook, node, &cb->chain); return node; } /*! \brief Removes a specific hook for the given callback. * \param cb pointer to Callback structure * \param hook address of hook function */ void uninstall_hook(struct Callback *cb, CBFUNC *hook) { /* Let it core if not found */ dlink_node *ptr = dlinkFind(&cb->chain, hook); dlinkDelete(ptr, &cb->chain); MyFree(ptr); } /*! \brief Displays registered callbacks and lengths of their hook chains. * (This is the handler of /stats h) * \param source_p pointer to struct Client */ void stats_hooks(struct Client *source_p) { char lastused[IRCD_BUFSIZE]; const dlink_node *ptr = NULL; sendto_one(source_p, ":%s %d %s : %-20s %-20s Used Hooks", me.name, RPL_STATSDEBUG, source_p->name, "Callback", "Last Execution"); sendto_one(source_p, ":%s %d %s : ------------------------------------" "--------------------", me.name, RPL_STATSDEBUG, source_p->name); DLINK_FOREACH(ptr, callback_list.head) { const struct Callback *cb = ptr->data; if (cb->last != 0) snprintf(lastused, sizeof(lastused), "%d seconds ago", (int) (CurrentTime - cb->last)); else strcpy(lastused, "NEVER"); sendto_one(source_p, ":%s %d %s : %-20s %-20s %-8u %d", me.name, RPL_STATSDEBUG, source_p->name, cb->name, lastused, cb->called, dlink_list_length(&cb->chain)); } } ircd-hybrid-8.1.13.dfsg.1/src/log.c0000644000175000017500000000626312263053413014727 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * log.c: Logger functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: log.c 1831 2013-04-15 10:57:05Z michael $ */ #include "stdinc.h" #include "log.h" #include "irc_string.h" #include "ircd.h" #include "conf.h" #include "s_misc.h" static struct { char path[HYB_PATH_MAX + 1]; size_t size; FILE *file; } log_type_table[LOG_TYPE_LAST]; void log_set_file(enum log_type type, size_t size, const char *path) { strlcpy(log_type_table[type].path, path, sizeof(log_type_table[type].path)); log_type_table[type].size = size; if (type == LOG_TYPE_IRCD) log_type_table[type].file = fopen(log_type_table[type].path, "a"); } void log_del_all(void) { unsigned int type = 0; while (++type < LOG_TYPE_LAST) log_type_table[type].path[0] = '\0'; } void log_reopen_all(void) { unsigned int type = 0; while (++type < LOG_TYPE_LAST) { if (log_type_table[type].file) { fclose(log_type_table[type].file); log_type_table[type].file = NULL; } if (log_type_table[type].path[0]) log_type_table[type].file = fopen(log_type_table[type].path, "a"); } } static int log_exceed_size(unsigned int type) { struct stat sb; if (!log_type_table[type].size) return 0; if (stat(log_type_table[type].path, &sb) < 0) return -1; return (size_t)sb.st_size > log_type_table[type].size; } static void log_write(enum log_type type, const char *message) { char buf[IRCD_BUFSIZE]; strftime(buf, sizeof(buf), "[%FT%H:%M:%S%z]", localtime(&CurrentTime)); fprintf(log_type_table[type].file, "%s %s\n", buf, message); fflush(log_type_table[type].file); } void ilog(enum log_type type, const char *fmt, ...) { char buf[LOG_BUFSIZE]; va_list args; if (!log_type_table[type].file || !ConfigLoggingEntry.use_logging) return; va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); log_write(type, buf); if (log_exceed_size(type) <= 0) return; snprintf(buf, sizeof(buf), "Rotating logfile %s", log_type_table[type].path); log_write(type, buf); fclose(log_type_table[type].file); log_type_table[type].file = NULL; snprintf(buf, sizeof(buf), "%s.old", log_type_table[type].path); unlink(buf); rename(log_type_table[type].path, buf); log_set_file(type, log_type_table[type].size, log_type_table[type].path); log_type_table[type].file = fopen(log_type_table[type].path, "a"); } ircd-hybrid-8.1.13.dfsg.1/src/rsa.c0000644000175000017500000000535512263053413014734 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * rsa.c: Functions for use with RSA public key cryptography. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: rsa.c 2135 2013-05-29 18:59:53Z michael $ */ #include "stdinc.h" #ifdef HAVE_LIBCRYPTO #include #include #include #include #include #include #include #include "memory.h" #include "rsa.h" #include "conf.h" #include "log.h" /* * report_crypto_errors - Dump crypto error list to log */ void report_crypto_errors(void) { unsigned long e = 0; while ((e = ERR_get_error())) ilog(LOG_TYPE_IRCD, "SSL error: %s", ERR_error_string(e, 0)); } static void binary_to_hex(unsigned char *bin, char *hex, int length) { static const char trans[] = "0123456789ABCDEF"; int i; for (i = 0; i < length; ++i) { hex[(i << 1) ] = trans[bin[i] >> 4]; hex[(i << 1) + 1] = trans[bin[i] & 0xf]; } hex[i << 1] = '\0'; } int get_randomness(unsigned char *buf, int length) { /* Seed OpenSSL PRNG with EGD enthropy pool -kre */ if (ConfigFileEntry.use_egd && ConfigFileEntry.egdpool_path) if (RAND_egd(ConfigFileEntry.egdpool_path) == -1) return -1; if (RAND_status()) return RAND_bytes(buf, length); /* XXX - abort? */ return RAND_pseudo_bytes(buf, length); } int generate_challenge(char **r_challenge, char **r_response, RSA *rsa) { unsigned char secret[32], *tmp; unsigned long length; int ret = -1; if (!rsa) return -1; get_randomness(secret, 32); *r_response = MyMalloc(65); binary_to_hex(secret, *r_response, 32); length = RSA_size(rsa); tmp = MyMalloc(length); ret = RSA_public_encrypt(32, secret, tmp, rsa, RSA_PKCS1_PADDING); *r_challenge = MyMalloc((length << 1) + 1); binary_to_hex( tmp, *r_challenge, length); (*r_challenge)[length<<1] = 0; MyFree(tmp); if (ret < 0) { report_crypto_errors(); return -1; } return 0; } #endif ircd-hybrid-8.1.13.dfsg.1/src/conf_lexer.c0000644000175000017500000042737312263053413016303 0ustar domdom #line 3 "conf_lexer.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ (yytext_ptr) -= (yy_more_len); \ yyleng = (size_t) (yy_cp - (yytext_ptr)); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 253 #define YY_END_OF_BUFFER 254 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[1629] = { 0, 4, 4, 254, 252, 4, 3, 252, 5, 252, 252, 6, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 4, 3, 0, 7, 5, 251, 0, 2, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 245, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, 0, 0, 0, 0, 173, 0, 0, 176, 0, 0, 0, 0, 182, 0, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 15, 0, 17, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 30, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 75, 234, 0, 0, 0, 82, 83, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 120, 121, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 135, 0, 0, 146, 0, 149, 0, 0, 0, 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, 230, 0, 226, 0, 0, 9, 0, 0, 0, 239, 0, 0, 21, 0, 0, 25, 0, 0, 0, 31, 0, 0, 0, 41, 0, 0, 44, 0, 0, 0, 0, 0, 0, 52, 0, 55, 0, 57, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 244, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 178, 0, 180, 183, 192, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 0, 0, 0, 229, 222, 225, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 94, 95, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 0, 236, 0, 0, 118, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 152, 0, 0, 156, 158, 0, 0, 0, 0, 238, 0, 167, 0, 0, 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 207, 0, 0, 0, 211, 0, 0, 0, 217, 218, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 0, 0, 119, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 237, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 208, 209, 0, 212, 213, 0, 219, 0, 0, 0, 0, 0, 0, 16, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 247, 115, 0, 0, 0, 0, 132, 0, 0, 0, 131, 0, 139, 0, 141, 0, 0, 0, 0, 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 241, 0, 0, 92, 0, 0, 0, 0, 0, 105, 107, 0, 0, 0, 0, 114, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 148, 0, 0, 154, 155, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, 104, 0, 0, 0, 111, 0, 0, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, 0, 0, 168, 169, 0, 172, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 93, 0, 103, 0, 0, 0, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 147, 151, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 43, 46, 0, 0, 0, 59, 60, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 125, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 179, 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 53, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, 124, 0, 0, 130, 0, 134, 0, 0, 0, 0, 0, 0, 165, 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 204, 220, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 58, 61, 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 71, 78, 0, 0, 85, 0, 0, 0, 0, 0, 109, 0, 116, 0, 0, 133, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 84, 0, 0, 0, 0, 108, 113, 0, 0, 129, 0, 136, 143, 0, 0, 0, 0, 0, 0, 0, 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 0, 190, 191, 194, 195, 196, 197, 198, 0, 0, 0, 0, 32, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 101, 102, 0, 128, 0, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 164, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 70, 80, 0, 0, 0, 163, 185, 0, 0, 0, 0, 0, 0, 39, 0, 0, 87, 0, 140, 0, 0, 200, 0, 0, 0, 0, 63, 117, 0, 0, 0, 0, 0, 40, 0, 189, 0, 0, 34, 0, 0, 0, 0, 0, 33, 0, 14, 186, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 7, 8, 9, 10, 9, 11, 12, 9, 13, 9, 9, 9, 1, 1, 14, 1, 15, 1, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 1, 1, 1, 1, 42, 1, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[69] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[1634] = { 0, 0, 0, 3124, 3125, 3121, 0, 66, 0, 64, 66, 66, 98, 43, 146, 75, 58, 85, 76, 117, 109, 51, 154, 155, 198, 240, 53, 193, 57, 191, 284, 324, 165, 122, 219, 123, 135, 3120, 0, 86, 3125, 0, 3125, 128, 3125, 0, 220, 145, 164, 181, 197, 192, 205, 211, 212, 230, 218, 237, 242, 262, 234, 247, 228, 332, 259, 245, 237, 263, 278, 282, 293, 330, 275, 296, 290, 338, 335, 296, 333, 334, 345, 340, 334, 335, 349, 342, 360, 377, 372, 387, 376, 386, 372, 367, 390, 384, 407, 388, 394, 421, 400, 417, 392, 401, 431, 394, 391, 409, 398, 478, 439, 442, 442, 443, 437, 443, 450, 442, 454, 470, 462, 473, 475, 474, 3079, 483, 485, 527, 498, 490, 498, 512, 510, 528, 520, 520, 524, 509, 3125, 526, 534, 517, 535, 536, 3078, 539, 540, 539, 540, 545, 554, 558, 552, 567, 556, 578, 557, 580, 3125, 584, 573, 569, 573, 581, 574, 588, 581, 591, 587, 598, 597, 598, 591, 592, 603, 597, 611, 617, 620, 607, 613, 3077, 618, 627, 175, 623, 619, 629, 628, 640, 640, 636, 628, 635, 3125, 642, 3076, 635, 655, 638, 636, 641, 658, 662, 671, 672, 655, 668, 666, 682, 685, 672, 686, 674, 687, 689, 678, 682, 697, 685, 685, 700, 709, 3125, 696, 693, 3075, 701, 717, 704, 3125, 712, 714, 3125, 728, 723, 719, 726, 3125, 735, 723, 726, 732, 740, 729, 747, 741, 750, 752, 737, 749, 751, 756, 762, 757, 757, 751, 765, 766, 777, 776, 775, 775, 3125, 783, 782, 785, 784, 3074, 3125, 798, 3125, 784, 800, 800, 794, 795, 3073, 791, 791, 807, 810, 3125, 3125, 810, 797, 3125, 801, 819, 818, 3072, 809, 817, 806, 829, 824, 823, 838, 832, 3125, 830, 832, 3125, 834, 836, 850, 856, 845, 855, 3071, 3125, 843, 850, 846, 846, 3125, 3125, 3070, 861, 3069, 867, 868, 864, 3068, 858, 873, 867, 880, 912, 890, 899, 883, 897, 895, 901, 3125, 3125, 902, 3067, 902, 3125, 904, 902, 908, 909, 918, 924, 938, 3066, 908, 3125, 3065, 3125, 936, 934, 940, 943, 945, 948, 948, 968, 3064, 954, 957, 956, 972, 967, 954, 3125, 963, 975, 973, 960, 3094, 1006, 966, 969, 977, 3094, 3061, 991, 992, 3125, 998, 991, 1005, 1006, 1004, 1002, 1013, 3125, 1019, 1003, 1011, 3060, 1009, 1009, 1024, 1013, 1012, 1014, 1026, 1034, 1026, 1028, 3125, 1028, 1035, 3125, 1052, 1061, 3125, 1059, 1062, 3059, 3125, 1056, 1060, 1059, 3125, 1066, 1061, 3125, 1061, 1074, 1059, 1066, 1077, 1068, 3125, 1078, 3125, 1084, 3058, 1074, 1071, 1068, 1080, 1079, 1092, 3125, 1093, 1092, 1090, 1094, 1098, 1115, 1094, 3057, 3056, 1109, 3055, 1109, 1106, 1125, 1127, 1130, 1124, 1121, 1130, 1120, 1130, 1139, 1136, 1122, 1117, 1138, 1143, 1133, 1148, 1136, 1158, 1163, 1153, 1155, 1171, 1168, 1178, 1172, 1167, 1166, 3054, 1186, 1173, 1167, 1187, 1202, 1179, 1183, 1183, 3125, 1209, 1199, 1203, 1191, 1214, 1209, 1222, 3125, 1215, 1215, 1234, 1223, 1235, 3053, 3125, 1239, 3052, 3125, 3125, 1236, 1234, 1238, 3051, 1224, 1242, 3125, 1236, 1232, 1241, 1242, 1254, 1249, 1259, 1267, 1257, 1266, 1274, 1267, 3079, 1268, 1271, 1284, 3125, 3125, 3125, 1287, 3049, 1273, 3125, 1284, 1278, 1281, 1288, 1281, 1286, 1290, 1283, 1282, 1289, 1285, 1294, 1308, 1302, 1305, 1307, 3048, 3125, 1329, 3047, 1319, 1320, 1323, 1334, 3046, 1317, 3045, 1337, 3044, 1338, 1340, 1327, 3043, 1346, 1337, 3125, 1342, 1331, 1348, 1351, 1357, 1355, 3125, 3125, 3125, 1361, 1353, 1369, 1362, 1366, 1383, 1381, 1384, 1376, 1372, 1376, 1373, 3125, 1376, 1380, 1388, 1387, 1383, 3125, 1398, 1400, 1404, 1395, 1402, 1408, 1396, 1394, 1409, 3042, 1403, 1419, 1412, 1411, 1434, 1425, 1440, 3125, 1424, 1428, 1435, 1426, 3041, 3125, 1432, 1444, 3125, 1448, 1433, 1430, 1446, 1454, 1438, 1457, 1451, 1456, 1443, 3125, 1451, 1454, 1453, 1454, 1459, 1469, 1465, 3040, 1471, 1512, 1480, 3039, 1480, 3038, 1483, 3125, 3125, 1493, 1498, 1484, 3125, 1502, 1504, 1502, 3125, 1491, 1496, 3125, 1507, 1497, 1494, 1512, 1517, 1506, 1522, 1520, 1517, 3125, 1523, 3125, 1540, 1535, 3037, 1531, 3036, 3035, 3034, 1547, 1545, 1546, 1546, 1557, 3033, 3125, 1542, 1550, 1556, 1561, 1556, 3125, 1550, 1564, 1557, 1560, 1557, 1562, 1569, 1579, 1570, 1568, 1585, 1582, 1573, 1595, 1584, 1600, 1601, 1592, 1598, 1610, 1614, 1603, 1613, 1618, 1609, 1619, 1615, 1614, 1622, 1621, 3125, 1623, 1606, 3125, 3125, 1626, 1615, 3032, 1628, 1616, 3031, 3030, 1632, 1624, 1623, 1626, 1642, 1645, 1640, 1645, 1656, 1662, 1654, 1657, 1662, 1663, 1655, 1656, 1674, 3125, 1671, 1655, 1667, 3125, 1661, 1673, 1669, 1666, 1679, 1674, 1678, 1676, 1674, 1687, 1700, 1694, 1695, 1691, 3029, 3028, 3027, 3026, 3025, 3024, 1709, 1714, 3023, 1716, 3022, 3125, 3125, 1718, 3125, 3125, 1717, 3125, 3021, 90, 1724, 1708, 1716, 1715, 3125, 3125, 1725, 1726, 1719, 1715, 3020, 1730, 1725, 1761, 1728, 1723, 1738, 1734, 3125, 1728, 1742, 1736, 1741, 1764, 1763, 1759, 1757, 1768, 1773, 1766, 1780, 1777, 1761, 1769, 3125, 1770, 1782, 1773, 1771, 1772, 1788, 1784, 1786, 1786, 1783, 3125, 1783, 1789, 1812, 1796, 3125, 1807, 3019, 1816, 1817, 1824, 1820, 1812, 3125, 1823, 1819, 1815, 1831, 3125, 1831, 1822, 1832, 3125, 1834, 3125, 1825, 3125, 1817, 1825, 1843, 1830, 3125, 1840, 1847, 1839, 1852, 1837, 1845, 1856, 1860, 1874, 1867, 1862, 1878, 1879, 3018, 1883, 1867, 1883, 1869, 1881, 1886, 1878, 1888, 1894, 1891, 1894, 1884, 1886, 1889, 1890, 1891, 3017, 1883, 1895, 1906, 1917, 1920, 1918, 1915, 322, 3054, 3042, 1911, 1934, 3014, 3013, 3008, 3125, 1931, 1934, 1932, 1929, 1926, 1928, 1923, 1944, 1941, 1943, 1948, 3125, 1937, 1947, 1933, 1946, 1957, 1957, 1947, 3006, 1940, 1952, 1964, 1955, 1965, 3005, 1984, 1975, 1976, 3003, 1980, 1985, 3125, 1981, 1994, 3125, 1995, 1977, 3002, 1978, 1987, 3125, 3125, 2015, 1983, 1983, 3000, 3125, 3125, 1992, 1986, 1984, 2004, 2011, 2999, 1999, 2002, 1997, 2018, 2998, 2997, 2024, 2996, 2023, 3125, 2032, 2026, 3125, 3125, 3125, 2027, 2024, 2044, 2025, 2044, 2035, 2037, 2047, 2049, 2037, 2048, 2052, 2042, 2041, 2060, 2048, 2049, 2059, 2053, 2056, 2057, 2065, 2067, 2066, 2073, 2075, 2080, 2092, 3125, 2084, 2089, 3033, 3032, 3020, 3019, 2083, 2083, 2098, 2100, 2083, 2093, 2092, 2096, 2097, 2102, 2101, 2097, 2109, 2108, 2117, 2103, 2117, 2109, 3125, 2121, 2117, 2128, 2127, 2142, 2141, 2139, 2148, 3125, 2150, 2150, 2139, 2155, 2989, 2138, 2145, 2988, 1973, 2145, 2138, 2140, 3125, 2150, 2149, 3125, 2161, 2166, 2165, 3125, 2156, 2164, 2173, 3125, 2165, 2162, 2176, 2176, 1474, 2179, 1473, 2178, 2178, 2182, 2186, 2187, 2204, 3125, 2205, 2191, 2207, 1469, 2198, 3125, 3125, 2213, 3125, 3125, 2206, 2214, 2210, 1174, 1168, 2200, 2221, 881, 2204, 2220, 2223, 2224, 2225, 2226, 2225, 2226, 2238, 2225, 2236, 2244, 2244, 2231, 2244, 2248, 2239, 2263, 872, 3125, 2246, 2251, 2258, 3125, 2260, 2264, 2256, 2259, 2266, 2256, 870, 2266, 2270, 2277, 2263, 2275, 2266, 3125, 867, 3125, 2270, 2270, 2294, 2293, 2286, 2293, 2305, 2293, 2294, 861, 3125, 2312, 3125, 2317, 2305, 2307, 3125, 2316, 2319, 2305, 2321, 2322, 2314, 2311, 2316, 2330, 2317, 2324, 2333, 3125, 2333, 3125, 3125, 3125, 493, 2332, 2335, 2343, 2355, 2356, 2359, 2355, 2355, 2362, 2359, 2360, 2373, 2357, 2358, 2359, 2360, 2361, 2368, 2364, 2366, 2384, 2367, 3125, 2376, 2376, 2374, 2378, 2387, 2388, 2398, 2390, 2409, 2395, 3125, 484, 2396, 2401, 3125, 3125, 2408, 2406, 2411, 3125, 3125, 2423, 2408, 2426, 2415, 3125, 2422, 2413, 2417, 477, 474, 2420, 2427, 2429, 3125, 2436, 2423, 2430, 2438, 2441, 2433, 2449, 2447, 3125, 3125, 437, 2445, 2460, 2458, 2453, 432, 2455, 2456, 2463, 2468, 2475, 2477, 2477, 3125, 3125, 2482, 2475, 2480, 2471, 428, 2482, 2487, 425, 415, 380, 377, 373, 2485, 2487, 290, 3125, 2492, 2490, 2480, 3125, 2484, 2480, 2481, 2488, 288, 2502, 259, 2512, 2513, 3125, 2506, 3125, 2509, 2506, 247, 2514, 2517, 2517, 3125, 2515, 2515, 2533, 2516, 2525, 2526, 2532, 239, 2534, 2523, 3125, 2537, 2528, 3125, 2528, 2537, 3125, 2548, 3125, 2550, 2550, 2533, 2542, 2554, 2544, 3125, 3125, 2552, 2556, 2557, 2564, 2577, 2564, 2575, 2573, 2574, 2575, 2576, 2577, 3125, 235, 2587, 3125, 3125, 2590, 2591, 229, 3125, 2575, 2595, 2585, 2582, 2598, 195, 2587, 3125, 191, 2604, 2595, 159, 2593, 3125, 2594, 2608, 2612, 2624, 2626, 2631, 2622, 2633, 2633, 2622, 2640, 2629, 2637, 2629, 2647, 2644, 3125, 2639, 2627, 153, 2649, 2635, 2649, 124, 2651, 2653, 2657, 2649, 2652, 2653, 2663, 2666, 2669, 2673, 3125, 3125, 2673, 310, 2683, 2671, 2690, 2677, 2696, 2695, 2690, 3125, 2679, 2695, 2687, 3125, 3125, 2689, 2685, 3125, 117, 2692, 2692, 2690, 2692, 3125, 2706, 114, 2703, 2696, 3125, 2705, 2701, 2716, 109, 2725, 107, 3125, 2719, 2719, 2727, 2725, 2741, 2734, 2737, 2738, 2739, 2740, 2738, 2739, 2750, 3125, 3125, 2755, 2743, 2741, 2755, 2748, 2748, 2762, 2750, 3125, 2753, 2756, 3125, 2759, 2760, 2770, 2780, 3125, 3125, 2769, 2782, 3125, 2781, 3125, 3125, 2788, 2790, 2794, 2799, 2799, 2800, 2802, 3125, 2782, 2783, 2784, 2785, 2786, 2793, 2799, 2797, 2803, 2799, 2800, 2805, 2810, 2812, 2823, 2828, 2834, 2837, 2836, 2842, 2830, 2835, 2845, 2837, 2853, 2850, 2848, 2852, 3125, 2845, 3125, 3125, 3125, 3125, 3125, 3125, 3125, 2854, 2860, 2846, 2860, 3125, 2863, 100, 2865, 2858, 3125, 2853, 2858, 2874, 2865, 2867, 3125, 3125, 2869, 3125, 2865, 2881, 2891, 2887, 2881, 2904, 3125, 2907, 2906, 2894, 2910, 2902, 2914, 2907, 2898, 2898, 2910, 3125, 2905, 2913, 2919, 3125, 2920, 2920, 2921, 2926, 2925, 3125, 95, 2918, 2917, 2923, 2932, 3125, 3125, 2930, 2941, 2951, 3125, 3125, 2951, 2943, 2943, 2960, 2963, 2946, 3125, 2964, 2955, 3125, 2965, 3125, 2953, 2967, 3125, 93, 2958, 2961, 2957, 3125, 3125, 2962, 2975, 2961, 2963, 2965, 3125, 2968, 3125, 2978, 2976, 3125, 2982, 2988, 2984, 2993, 3004, 3125, 2990, 3125, 3125, 3125, 105, 3052, 97, 84, 81 } ; static yyconst flex_int16_t yy_def[1634] = { 0, 1628, 1, 1628, 1628, 1628, 1629, 1630, 1631, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1629, 1630, 1628, 1631, 1628, 1628, 1628, 1631, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1632, 1633, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1632, 1632, 1633, 1633, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 0, 1628, 1628, 1628, 1628, 1628 } ; static yyconst flex_int16_t yy_nxt[3194] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 11, 11, 11, 11, 4, 4, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 4, 4, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 4, 40, 40, 42, 44, 53, 45, 46, 46, 46, 46, 46, 67, 84, 1027, 54, 103, 1025, 68, 69, 43, 40, 40, 62, 915, 107, 916, 63, 75, 70, 41, 64, 53, 71, 65, 76, 917, 66, 38, 67, 84, 72, 54, 103, 73, 68, 69, 43, 47, 48, 62, 49, 107, 74, 63, 75, 70, 50, 64, 51, 71, 65, 76, 81, 66, 77, 52, 1610, 72, 1591, 82, 73, 83, 78, 1557, 47, 48, 129, 49, 79, 74, 1485, 132, 1483, 50, 80, 51, 133, 1477, 134, 81, 1471, 77, 52, 55, 135, 56, 82, 1445, 83, 78, 57, 58, 85, 129, 59, 79, 89, 60, 132, 86, 90, 80, 87, 133, 88, 134, 91, 61, 315, 316, 55, 135, 56, 136, 126, 127, 1441, 57, 58, 85, 128, 59, 1420, 89, 60, 1417, 86, 90, 108, 87, 104, 88, 109, 91, 61, 92, 93, 137, 105, 94, 136, 126, 127, 95, 106, 138, 110, 128, 139, 96, 46, 46, 46, 46, 46, 108, 130, 104, 1415, 109, 131, 140, 92, 93, 137, 105, 94, 141, 142, 145, 95, 106, 138, 110, 146, 139, 96, 97, 143, 98, 144, 99, 147, 130, 150, 100, 151, 131, 140, 152, 160, 101, 1408, 161, 141, 142, 145, 102, 1404, 148, 158, 146, 1378, 162, 97, 143, 98, 144, 99, 147, 1367, 150, 100, 151, 159, 163, 152, 160, 101, 149, 161, 164, 1361, 170, 102, 111, 148, 158, 112, 113, 162, 114, 165, 171, 166, 115, 116, 117, 172, 118, 119, 159, 163, 1457, 1458, 915, 149, 916, 164, 167, 170, 1359, 111, 1351, 177, 112, 113, 917, 114, 165, 171, 166, 115, 116, 117, 172, 118, 119, 120, 153, 154, 121, 122, 178, 155, 168, 167, 173, 123, 124, 175, 177, 156, 181, 169, 125, 176, 157, 174, 179, 182, 180, 183, 184, 185, 120, 153, 154, 121, 122, 178, 155, 168, 186, 173, 123, 124, 175, 187, 156, 181, 169, 125, 176, 157, 174, 179, 182, 180, 183, 184, 185, 188, 189, 190, 193, 191, 195, 197, 194, 186, 192, 196, 198, 199, 187, 1348, 203, 204, 207, 1347, 210, 211, 1346, 215, 216, 217, 200, 218, 188, 189, 190, 193, 191, 195, 197, 194, 201, 192, 196, 198, 199, 205, 202, 203, 204, 207, 208, 210, 211, 212, 215, 216, 217, 200, 218, 226, 206, 1345, 231, 209, 227, 235, 233, 201, 236, 213, 214, 1344, 205, 202, 1341, 228, 232, 208, 1329, 229, 212, 230, 239, 1324, 237, 240, 226, 206, 234, 231, 241, 227, 235, 233, 238, 236, 213, 214, 219, 242, 220, 221, 228, 232, 243, 222, 229, 223, 230, 239, 224, 237, 240, 244, 245, 234, 225, 241, 247, 248, 1312, 238, 255, 1311, 256, 219, 242, 220, 221, 257, 1298, 243, 222, 259, 223, 258, 260, 224, 261, 1265, 244, 245, 264, 225, 265, 247, 248, 249, 262, 255, 250, 256, 266, 267, 268, 271, 257, 251, 252, 272, 259, 269, 258, 260, 253, 261, 263, 273, 270, 264, 254, 265, 275, 276, 249, 262, 277, 250, 278, 266, 267, 268, 271, 279, 251, 252, 272, 280, 269, 281, 282, 253, 283, 263, 273, 270, 284, 254, 285, 275, 276, 286, 287, 277, 288, 278, 289, 290, 291, 292, 279, 293, 294, 295, 280, 296, 281, 282, 297, 283, 298, 299, 302, 284, 300, 285, 303, 304, 286, 287, 305, 288, 306, 289, 290, 291, 292, 301, 293, 294, 295, 307, 296, 308, 309, 297, 310, 298, 299, 302, 311, 300, 313, 303, 304, 314, 317, 305, 318, 306, 319, 321, 322, 320, 301, 323, 324, 325, 307, 326, 308, 309, 327, 310, 329, 330, 333, 311, 331, 313, 334, 335, 314, 317, 332, 318, 336, 319, 321, 322, 320, 337, 323, 324, 325, 338, 326, 339, 340, 327, 341, 329, 330, 333, 342, 331, 346, 334, 335, 347, 348, 343, 349, 336, 350, 351, 344, 352, 337, 353, 354, 345, 338, 355, 339, 340, 356, 341, 357, 358, 359, 342, 360, 346, 361, 363, 347, 348, 343, 349, 364, 350, 351, 344, 352, 365, 353, 354, 345, 366, 355, 367, 368, 356, 369, 357, 358, 359, 370, 360, 371, 361, 363, 372, 373, 375, 376, 364, 377, 374, 378, 379, 365, 380, 382, 383, 366, 384, 367, 368, 385, 369, 386, 381, 387, 370, 388, 371, 389, 392, 372, 373, 375, 376, 390, 377, 393, 378, 379, 394, 380, 382, 383, 391, 384, 395, 396, 385, 397, 386, 381, 387, 398, 388, 399, 389, 392, 400, 401, 402, 404, 390, 405, 393, 406, 407, 394, 408, 409, 411, 412, 413, 395, 396, 414, 397, 415, 416, 417, 398, 418, 399, 419, 421, 400, 401, 402, 404, 422, 405, 423, 406, 407, 424, 408, 409, 411, 412, 413, 425, 426, 414, 427, 415, 416, 417, 428, 418, 429, 419, 421, 430, 431, 432, 433, 422, 434, 423, 436, 438, 424, 440, 441, 442, 443, 445, 425, 426, 447, 427, 435, 437, 448, 428, 449, 429, 451, 452, 430, 431, 432, 433, 453, 434, 454, 436, 438, 1246, 440, 441, 442, 443, 445, 1234, 464, 447, 1227, 435, 1217, 448, 465, 449, 466, 451, 452, 467, 469, 1198, 470, 453, 468, 454, 455, 456, 457, 471, 473, 474, 458, 475, 459, 464, 476, 460, 477, 461, 478, 465, 479, 466, 485, 462, 467, 469, 463, 470, 487, 468, 480, 455, 456, 457, 471, 473, 474, 458, 475, 459, 488, 476, 460, 477, 461, 478, 489, 479, 481, 485, 462, 490, 482, 463, 491, 487, 483, 480, 492, 493, 494, 496, 497, 503, 498, 504, 505, 488, 500, 506, 507, 508, 501, 489, 499, 481, 513, 502, 490, 482, 514, 491, 515, 518, 519, 492, 493, 494, 496, 497, 503, 498, 504, 505, 520, 500, 506, 507, 508, 501, 510, 511, 521, 513, 502, 522, 523, 514, 524, 515, 518, 519, 525, 526, 529, 527, 512, 530, 532, 533, 534, 520, 528, 535, 536, 537, 538, 510, 511, 521, 539, 540, 522, 523, 542, 524, 541, 543, 544, 525, 526, 529, 527, 512, 530, 532, 533, 534, 545, 528, 535, 536, 537, 538, 546, 547, 548, 539, 540, 550, 551, 542, 552, 541, 543, 544, 553, 554, 555, 556, 557, 558, 559, 560, 561, 545, 562, 564, 565, 566, 567, 546, 547, 548, 568, 571, 550, 551, 572, 552, 573, 574, 569, 553, 554, 555, 556, 557, 558, 559, 560, 561, 570, 562, 564, 565, 566, 567, 575, 576, 577, 568, 571, 580, 582, 572, 583, 573, 574, 569, 584, 585, 586, 587, 589, 590, 591, 588, 596, 570, 592, 594, 597, 598, 599, 575, 576, 577, 600, 601, 580, 582, 593, 583, 602, 595, 603, 584, 585, 586, 587, 589, 590, 591, 588, 596, 604, 592, 594, 597, 598, 599, 607, 605, 608, 600, 601, 609, 610, 593, 606, 602, 595, 603, 611, 612, 613, 614, 616, 617, 618, 620, 621, 604, 625, 619, 1195, 626, 627, 607, 605, 608, 1194, 622, 609, 610, 623, 606, 630, 631, 632, 611, 612, 613, 614, 616, 617, 618, 620, 621, 633, 625, 619, 624, 626, 627, 628, 636, 634, 629, 622, 635, 637, 623, 638, 630, 631, 632, 639, 640, 641, 643, 645, 649, 650, 652, 646, 633, 653, 647, 624, 654, 648, 628, 636, 634, 629, 655, 635, 637, 656, 638, 657, 658, 659, 639, 640, 641, 643, 645, 649, 650, 652, 646, 660, 653, 647, 661, 654, 648, 662, 663, 664, 665, 655, 667, 668, 656, 669, 657, 658, 659, 670, 672, 673, 674, 675, 678, 676, 679, 680, 660, 681, 682, 661, 683, 684, 662, 663, 664, 665, 685, 667, 668, 686, 669, 677, 687, 688, 670, 672, 673, 674, 675, 678, 676, 679, 680, 689, 681, 682, 691, 683, 684, 693, 694, 695, 701, 685, 696, 697, 686, 703, 705, 687, 688, 706, 708, 698, 710, 711, 712, 713, 699, 714, 689, 715, 707, 691, 716, 717, 693, 694, 695, 701, 718, 696, 697, 719, 703, 705, 720, 721, 706, 708, 698, 710, 711, 712, 713, 699, 714, 722, 715, 707, 725, 716, 717, 726, 723, 727, 728, 718, 729, 730, 719, 724, 731, 720, 721, 732, 733, 734, 735, 736, 737, 738, 739, 740, 722, 741, 742, 725, 743, 744, 726, 723, 727, 728, 746, 729, 730, 747, 724, 731, 748, 749, 732, 733, 734, 735, 736, 737, 738, 739, 740, 750, 741, 742, 751, 743, 744, 752, 753, 754, 755, 746, 756, 758, 747, 759, 760, 748, 749, 761, 762, 763, 764, 765, 766, 767, 768, 769, 750, 770, 771, 751, 772, 773, 752, 753, 754, 755, 774, 756, 758, 775, 759, 760, 776, 777, 761, 762, 763, 764, 765, 766, 767, 768, 769, 779, 770, 771, 786, 772, 773, 788, 1188, 790, 791, 774, 1178, 1176, 775, 792, 793, 776, 777, 794, 795, 796, 797, 798, 799, 800, 801, 802, 779, 780, 803, 786, 804, 781, 788, 782, 790, 791, 805, 783, 784, 806, 792, 793, 807, 785, 794, 795, 796, 797, 798, 799, 800, 801, 802, 808, 780, 803, 809, 804, 781, 810, 782, 812, 816, 805, 783, 784, 806, 817, 818, 807, 785, 819, 820, 822, 823, 825, 826, 827, 828, 829, 808, 830, 831, 809, 824, 832, 810, 833, 812, 816, 834, 835, 836, 837, 817, 818, 838, 839, 819, 820, 822, 823, 825, 826, 827, 828, 829, 840, 830, 831, 841, 824, 832, 842, 833, 843, 844, 834, 835, 836, 837, 845, 846, 838, 839, 847, 848, 849, 850, 851, 852, 853, 854, 855, 840, 856, 857, 841, 858, 859, 842, 860, 843, 844, 861, 863, 864, 867, 845, 846, 868, 869, 847, 848, 849, 850, 851, 852, 853, 854, 855, 870, 856, 857, 871, 858, 859, 872, 860, 873, 874, 861, 863, 864, 867, 875, 876, 868, 869, 877, 878, 879, 880, 881, 882, 883, 884, 885, 870, 886, 887, 871, 888, 889, 872, 890, 873, 874, 891, 892, 893, 894, 875, 876, 895, 896, 877, 878, 879, 880, 881, 882, 883, 884, 885, 897, 886, 887, 898, 888, 889, 899, 890, 900, 907, 891, 892, 893, 894, 908, 910, 895, 896, 912, 913, 918, 919, 920, 921, 922, 923, 924, 897, 925, 929, 898, 927, 933, 899, 934, 900, 907, 935, 936, 937, 938, 908, 910, 939, 928, 912, 913, 918, 919, 920, 921, 922, 923, 924, 940, 925, 929, 930, 927, 933, 941, 934, 931, 942, 935, 936, 937, 938, 943, 944, 939, 928, 945, 946, 932, 947, 948, 949, 950, 951, 952, 940, 953, 954, 930, 955, 956, 941, 957, 931, 942, 958, 959, 960, 961, 943, 944, 962, 963, 945, 946, 932, 947, 948, 949, 950, 951, 952, 964, 953, 954, 965, 955, 956, 966, 957, 968, 969, 958, 959, 960, 961, 970, 971, 962, 963, 972, 973, 974, 975, 976, 978, 979, 980, 981, 964, 982, 983, 965, 984, 977, 966, 985, 968, 969, 986, 987, 988, 989, 970, 971, 990, 991, 972, 973, 974, 975, 976, 978, 979, 980, 981, 992, 982, 983, 993, 984, 977, 994, 985, 995, 996, 986, 987, 988, 989, 997, 998, 990, 991, 999, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 992, 1009, 1010, 993, 1011, 1012, 994, 1013, 995, 996, 1014, 1015, 1016, 1018, 997, 998, 1019, 1020, 999, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1021, 1009, 1010, 1022, 1011, 1012, 1023, 1013, 1024, 1029, 1014, 1015, 1016, 1018, 1030, 1034, 1019, 1020, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1021, 1044, 1045, 1022, 1046, 1047, 1023, 1048, 1024, 1029, 1049, 1050, 1051, 1053, 1030, 1034, 1054, 1055, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1056, 1044, 1045, 1057, 1046, 1047, 1061, 1048, 1062, 1064, 1049, 1050, 1051, 1053, 1059, 1065, 1054, 1055, 1060, 1066, 1067, 1068, 1069, 1071, 1072, 1160, 1076, 1056, 1077, 1079, 1057, 1080, 1081, 1061, 1082, 1062, 1064, 1083, 1085, 1086, 1087, 1059, 1065, 1073, 1088, 1060, 1066, 1067, 1068, 1069, 1071, 1072, 1074, 1076, 1091, 1077, 1079, 1093, 1080, 1081, 1075, 1082, 1094, 1095, 1083, 1085, 1086, 1087, 1096, 1097, 1073, 1088, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1074, 1105, 1091, 1106, 1107, 1093, 1108, 1109, 1075, 1110, 1094, 1095, 1111, 1112, 1113, 1114, 1096, 1097, 1115, 1116, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1117, 1105, 1118, 1106, 1107, 1119, 1108, 1109, 1120, 1110, 1121, 1122, 1111, 1112, 1113, 1114, 1123, 1124, 1115, 1116, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1117, 1132, 1118, 1133, 1134, 1119, 1135, 1136, 1120, 1137, 1121, 1122, 1138, 1139, 1140, 1141, 1123, 1124, 1142, 1143, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1144, 1132, 1145, 1133, 1134, 1146, 1135, 1136, 1147, 1137, 1148, 1149, 1138, 1139, 1140, 1141, 1150, 1151, 1142, 1143, 1152, 1153, 1154, 1155, 1157, 1158, 1161, 1144, 1162, 1145, 1163, 1164, 1146, 1165, 1166, 1147, 1167, 1148, 1149, 1168, 1169, 1170, 1171, 1150, 1151, 1172, 1173, 1152, 1153, 1154, 1155, 1157, 1158, 1161, 1174, 1162, 1175, 1163, 1164, 1177, 1165, 1166, 1179, 1167, 1180, 1181, 1168, 1169, 1170, 1171, 1182, 1183, 1172, 1173, 1184, 1185, 1186, 1187, 1189, 1190, 1191, 1174, 1192, 1175, 1193, 1196, 1177, 1197, 1199, 1179, 1200, 1180, 1181, 1201, 1202, 1203, 1204, 1182, 1183, 1205, 1206, 1184, 1185, 1186, 1187, 1189, 1190, 1191, 1207, 1192, 1208, 1193, 1196, 1209, 1197, 1199, 1210, 1200, 1211, 1212, 1201, 1202, 1203, 1204, 1213, 1214, 1205, 1206, 1215, 1216, 1218, 1219, 1220, 1221, 1222, 1207, 1223, 1208, 1224, 1225, 1209, 1226, 1228, 1210, 1229, 1211, 1212, 1230, 1231, 1232, 1233, 1213, 1214, 1235, 1236, 1215, 1216, 1218, 1219, 1220, 1221, 1222, 1237, 1223, 1238, 1224, 1225, 1239, 1226, 1228, 1240, 1229, 1241, 1242, 1230, 1231, 1232, 1233, 1244, 1245, 1235, 1236, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1243, 1238, 1255, 1256, 1239, 1257, 1258, 1240, 1259, 1241, 1242, 1261, 1262, 1263, 1260, 1244, 1245, 1264, 1266, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1243, 1267, 1255, 1256, 1268, 1257, 1258, 1269, 1259, 1270, 1271, 1261, 1262, 1263, 1260, 1272, 1273, 1264, 1266, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1267, 1283, 1284, 1268, 1285, 1286, 1269, 1287, 1270, 1271, 1288, 1289, 1290, 1291, 1272, 1273, 1292, 1293, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1294, 1283, 1284, 1295, 1285, 1286, 1296, 1287, 1297, 1299, 1288, 1289, 1290, 1291, 1300, 1301, 1292, 1293, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1294, 1313, 1314, 1295, 1315, 1316, 1296, 1317, 1297, 1299, 1318, 1319, 1320, 1321, 1300, 1301, 1322, 1323, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1325, 1313, 1314, 1326, 1315, 1316, 1327, 1317, 1328, 1330, 1318, 1319, 1320, 1321, 1331, 1332, 1322, 1323, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1342, 1325, 1343, 1349, 1326, 1350, 1352, 1327, 1353, 1328, 1330, 1354, 1355, 1356, 1357, 1331, 1332, 1358, 1360, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1342, 1362, 1343, 1349, 1363, 1350, 1352, 1364, 1353, 1365, 1366, 1354, 1355, 1356, 1357, 1368, 1369, 1358, 1360, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1379, 1362, 1380, 1381, 1363, 1382, 1383, 1364, 1384, 1365, 1366, 1385, 1386, 1387, 1388, 1368, 1369, 1389, 1390, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1379, 1391, 1380, 1381, 1392, 1382, 1383, 1393, 1384, 1394, 1395, 1385, 1386, 1387, 1388, 1396, 1397, 1389, 1390, 1398, 1399, 1400, 1401, 1402, 1403, 1405, 1406, 1407, 1391, 1409, 1410, 1392, 1411, 1412, 1393, 1413, 1394, 1395, 1414, 1416, 1418, 1419, 1396, 1397, 1421, 1422, 1398, 1399, 1400, 1401, 1402, 1403, 1405, 1406, 1407, 1423, 1409, 1410, 1424, 1411, 1412, 1425, 1413, 1426, 1427, 1414, 1416, 1418, 1419, 1428, 1430, 1421, 1422, 1431, 1432, 1429, 1433, 1434, 1435, 1436, 1437, 1438, 1423, 1439, 1440, 1424, 1442, 1443, 1425, 1444, 1426, 1427, 1446, 1447, 1448, 1449, 1428, 1430, 1450, 1451, 1431, 1432, 1429, 1433, 1434, 1435, 1436, 1437, 1438, 1452, 1439, 1440, 1453, 1442, 1443, 1454, 1444, 1455, 1456, 1446, 1447, 1448, 1449, 1459, 1460, 1450, 1451, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1452, 1470, 1472, 1453, 1473, 1474, 1454, 1475, 1455, 1456, 1476, 1478, 1479, 1480, 1459, 1460, 1481, 1482, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1484, 1470, 1472, 1486, 1473, 1474, 1487, 1475, 1488, 1489, 1476, 1478, 1479, 1480, 1490, 1491, 1481, 1482, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1484, 1501, 1502, 1486, 1503, 1504, 1487, 1505, 1488, 1489, 1506, 1507, 1508, 1509, 1490, 1491, 1510, 1511, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1512, 1501, 1502, 1513, 1503, 1504, 1514, 1505, 1515, 1516, 1506, 1507, 1508, 1509, 1517, 1518, 1510, 1511, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1512, 1528, 1529, 1513, 1530, 1531, 1514, 1532, 1515, 1516, 1533, 1534, 1535, 1536, 1517, 1518, 1537, 1538, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1539, 1528, 1529, 1540, 1530, 1531, 1541, 1532, 1542, 1543, 1533, 1534, 1535, 1536, 1544, 1545, 1537, 1538, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1539, 1555, 1556, 1540, 1558, 1559, 1541, 1560, 1542, 1543, 1561, 1562, 1563, 1564, 1544, 1545, 1565, 1566, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1567, 1555, 1556, 1568, 1558, 1559, 1569, 1560, 1570, 1571, 1561, 1562, 1563, 1564, 1572, 1573, 1565, 1566, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1567, 1583, 1584, 1568, 1585, 1586, 1569, 1587, 1570, 1571, 1588, 1589, 1590, 1592, 1572, 1573, 1593, 1594, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1595, 1583, 1584, 1596, 1585, 1586, 1597, 1587, 1598, 1599, 1588, 1589, 1590, 1592, 1600, 1601, 1593, 1594, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1611, 1595, 1612, 1613, 1596, 1614, 1615, 1597, 1616, 1598, 1599, 1617, 1618, 1619, 1620, 1600, 1601, 1621, 1622, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1611, 1623, 1612, 1613, 1624, 1614, 1615, 1625, 1616, 1626, 1627, 1617, 1618, 1619, 1620, 1159, 1156, 1621, 1622, 1028, 1028, 1026, 1026, 1092, 1090, 1089, 1084, 1078, 1623, 1070, 1063, 1624, 1058, 1052, 1625, 1033, 1626, 1627, 39, 39, 1032, 1031, 1028, 1026, 1017, 1000, 967, 926, 914, 911, 909, 906, 905, 904, 903, 902, 901, 866, 865, 862, 821, 815, 814, 813, 811, 789, 787, 778, 757, 745, 709, 704, 702, 700, 692, 690, 671, 666, 651, 644, 642, 615, 581, 579, 578, 563, 549, 531, 517, 516, 509, 495, 486, 484, 472, 450, 446, 444, 439, 420, 410, 403, 362, 328, 312, 274, 246, 37, 37, 1628, 3, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628 } ; static yyconst flex_int16_t yy_chk[3194] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 9, 10, 13, 10, 11, 11, 11, 11, 11, 16, 21, 1633, 13, 26, 1632, 16, 16, 9, 39, 39, 15, 799, 28, 799, 15, 18, 16, 1631, 15, 13, 17, 15, 18, 799, 15, 1629, 16, 21, 17, 13, 26, 17, 16, 16, 9, 12, 12, 15, 12, 28, 17, 15, 18, 16, 12, 15, 12, 17, 15, 18, 20, 15, 19, 12, 1602, 17, 1575, 20, 17, 20, 19, 1534, 12, 12, 33, 12, 19, 17, 1442, 35, 1440, 12, 19, 12, 36, 1433, 43, 20, 1426, 19, 12, 14, 47, 14, 20, 1395, 20, 19, 14, 14, 22, 33, 14, 19, 23, 14, 35, 22, 23, 19, 22, 36, 22, 43, 23, 14, 184, 184, 14, 47, 14, 48, 32, 32, 1391, 14, 14, 22, 32, 14, 1369, 23, 14, 1366, 22, 23, 29, 22, 27, 22, 29, 23, 14, 24, 24, 49, 27, 24, 48, 32, 32, 24, 27, 50, 29, 32, 51, 24, 46, 46, 46, 46, 46, 29, 34, 27, 1363, 29, 34, 52, 24, 24, 49, 27, 24, 53, 54, 56, 24, 27, 50, 29, 57, 51, 24, 25, 55, 25, 55, 25, 58, 34, 60, 25, 61, 34, 52, 62, 65, 25, 1356, 66, 53, 54, 56, 25, 1350, 59, 64, 57, 1317, 67, 25, 55, 25, 55, 25, 58, 1305, 60, 25, 61, 64, 68, 62, 65, 25, 59, 66, 69, 1297, 72, 25, 30, 59, 64, 30, 30, 67, 30, 70, 73, 70, 30, 30, 30, 74, 30, 30, 64, 68, 1409, 1409, 915, 59, 915, 69, 70, 72, 1295, 30, 1285, 77, 30, 30, 915, 30, 70, 73, 70, 30, 30, 30, 74, 30, 30, 31, 63, 63, 31, 31, 78, 63, 71, 70, 75, 31, 31, 76, 77, 63, 80, 71, 31, 76, 63, 75, 79, 81, 79, 82, 83, 84, 31, 63, 63, 31, 31, 78, 63, 71, 85, 75, 31, 31, 76, 86, 63, 80, 71, 31, 76, 63, 75, 79, 81, 79, 82, 83, 84, 87, 88, 89, 91, 90, 92, 93, 91, 85, 90, 92, 94, 95, 86, 1282, 97, 98, 100, 1281, 102, 103, 1280, 105, 106, 107, 96, 108, 87, 88, 89, 91, 90, 92, 93, 91, 96, 90, 92, 94, 95, 99, 96, 97, 98, 100, 101, 102, 103, 104, 105, 106, 107, 96, 108, 110, 99, 1279, 112, 101, 111, 114, 113, 96, 115, 104, 104, 1278, 99, 96, 1275, 111, 112, 101, 1261, 111, 104, 111, 117, 1256, 116, 118, 110, 99, 113, 112, 119, 111, 114, 113, 116, 115, 104, 104, 109, 120, 109, 109, 111, 112, 121, 109, 111, 109, 111, 117, 109, 116, 118, 122, 123, 113, 109, 119, 125, 126, 1241, 116, 128, 1240, 129, 109, 120, 109, 109, 130, 1222, 121, 109, 131, 109, 130, 131, 109, 132, 1187, 122, 123, 134, 109, 135, 125, 126, 127, 133, 128, 127, 129, 136, 137, 139, 141, 130, 127, 127, 142, 131, 140, 130, 131, 127, 132, 133, 143, 140, 134, 127, 135, 145, 146, 127, 133, 147, 127, 148, 136, 137, 139, 141, 149, 127, 127, 142, 150, 140, 151, 152, 127, 153, 133, 143, 140, 154, 127, 155, 145, 146, 156, 157, 147, 159, 148, 160, 161, 162, 163, 149, 164, 165, 166, 150, 167, 151, 152, 168, 153, 169, 170, 172, 154, 171, 155, 173, 174, 156, 157, 175, 159, 176, 160, 161, 162, 163, 171, 164, 165, 166, 177, 167, 178, 178, 168, 179, 169, 170, 172, 180, 171, 182, 173, 174, 183, 185, 175, 186, 176, 187, 188, 189, 187, 171, 190, 191, 192, 177, 193, 178, 178, 195, 179, 197, 198, 200, 180, 199, 182, 201, 202, 183, 185, 199, 186, 203, 187, 188, 189, 187, 204, 190, 191, 192, 205, 193, 206, 207, 195, 208, 197, 198, 200, 209, 199, 210, 201, 202, 211, 212, 209, 213, 203, 214, 215, 209, 216, 204, 217, 218, 209, 205, 219, 206, 207, 220, 208, 221, 222, 224, 209, 225, 210, 225, 227, 211, 212, 209, 213, 228, 214, 215, 209, 216, 229, 217, 218, 209, 231, 219, 232, 234, 220, 235, 221, 222, 224, 236, 225, 237, 225, 227, 239, 240, 241, 242, 228, 243, 240, 244, 245, 229, 246, 247, 248, 231, 249, 232, 234, 250, 235, 251, 246, 252, 236, 253, 237, 254, 256, 239, 240, 241, 242, 255, 243, 257, 244, 245, 258, 246, 247, 248, 255, 249, 259, 260, 250, 261, 251, 246, 252, 262, 253, 264, 254, 256, 265, 266, 267, 270, 255, 272, 257, 273, 274, 258, 275, 276, 278, 279, 280, 259, 260, 281, 261, 284, 285, 287, 262, 288, 264, 289, 291, 265, 266, 267, 270, 292, 272, 293, 273, 274, 294, 275, 276, 278, 279, 280, 295, 296, 281, 297, 284, 285, 287, 298, 288, 300, 289, 291, 301, 303, 304, 305, 292, 306, 293, 307, 308, 294, 311, 312, 313, 314, 318, 295, 296, 320, 297, 306, 307, 321, 298, 322, 300, 324, 325, 301, 303, 304, 305, 326, 306, 327, 307, 308, 1162, 311, 312, 313, 314, 318, 1151, 329, 320, 1143, 306, 1131, 321, 330, 322, 331, 324, 325, 332, 333, 1112, 334, 326, 332, 327, 328, 328, 328, 337, 339, 341, 328, 342, 328, 329, 343, 328, 344, 328, 345, 330, 346, 331, 349, 328, 332, 333, 328, 334, 353, 332, 347, 328, 328, 328, 337, 339, 341, 328, 342, 328, 354, 343, 328, 344, 328, 345, 355, 346, 347, 349, 328, 356, 347, 328, 357, 353, 347, 347, 358, 359, 360, 362, 363, 366, 364, 367, 369, 354, 365, 370, 371, 372, 365, 355, 364, 347, 375, 365, 356, 347, 376, 357, 377, 380, 381, 358, 359, 360, 362, 363, 366, 364, 367, 369, 383, 365, 370, 371, 372, 365, 374, 374, 384, 375, 365, 385, 386, 376, 387, 377, 380, 381, 388, 389, 392, 391, 374, 393, 395, 396, 397, 383, 391, 398, 399, 400, 401, 374, 374, 384, 402, 403, 385, 386, 404, 387, 403, 406, 407, 388, 389, 392, 391, 374, 393, 395, 396, 397, 409, 391, 398, 399, 400, 401, 410, 412, 413, 402, 403, 416, 417, 404, 418, 403, 406, 407, 420, 421, 423, 424, 425, 426, 427, 428, 430, 409, 432, 434, 435, 436, 437, 410, 412, 413, 438, 441, 416, 417, 442, 418, 443, 444, 439, 420, 421, 423, 424, 425, 426, 427, 428, 430, 439, 432, 434, 435, 436, 437, 445, 446, 447, 438, 441, 450, 452, 442, 453, 443, 444, 439, 454, 455, 456, 457, 458, 459, 460, 457, 463, 439, 461, 462, 464, 465, 466, 445, 446, 447, 467, 468, 450, 452, 461, 453, 469, 462, 470, 454, 455, 456, 457, 458, 459, 460, 457, 463, 471, 461, 462, 464, 465, 466, 473, 472, 474, 467, 468, 475, 476, 461, 472, 469, 462, 470, 477, 478, 479, 480, 482, 483, 483, 484, 485, 471, 487, 483, 1109, 488, 489, 473, 472, 474, 1108, 485, 475, 476, 486, 472, 492, 493, 494, 477, 478, 479, 480, 482, 483, 483, 484, 485, 495, 487, 483, 486, 488, 489, 491, 497, 496, 491, 485, 496, 499, 486, 500, 492, 493, 494, 501, 502, 503, 506, 510, 511, 512, 514, 510, 495, 515, 510, 486, 517, 510, 491, 497, 496, 491, 518, 496, 499, 519, 500, 520, 521, 522, 501, 502, 503, 506, 510, 511, 512, 514, 510, 523, 515, 510, 524, 517, 510, 525, 526, 527, 528, 518, 530, 531, 519, 532, 520, 521, 522, 536, 538, 540, 541, 542, 544, 543, 545, 546, 523, 547, 548, 524, 549, 550, 525, 526, 527, 528, 551, 530, 531, 552, 532, 543, 553, 554, 536, 538, 540, 541, 542, 544, 543, 545, 546, 555, 547, 548, 558, 549, 550, 560, 561, 562, 565, 551, 563, 563, 552, 567, 569, 553, 554, 570, 571, 563, 573, 574, 576, 577, 563, 578, 555, 579, 570, 558, 580, 581, 560, 561, 562, 565, 585, 563, 563, 586, 567, 569, 587, 588, 570, 571, 563, 573, 574, 576, 577, 563, 578, 589, 579, 570, 591, 580, 581, 592, 590, 593, 594, 585, 595, 596, 586, 590, 598, 587, 588, 599, 600, 601, 602, 604, 605, 606, 607, 608, 589, 609, 610, 591, 611, 612, 592, 590, 593, 594, 614, 595, 596, 615, 590, 598, 616, 617, 599, 600, 601, 602, 604, 605, 606, 607, 608, 618, 609, 610, 619, 611, 612, 620, 622, 623, 624, 614, 625, 628, 615, 629, 631, 616, 617, 632, 633, 634, 635, 636, 637, 638, 638, 639, 618, 640, 642, 619, 643, 644, 620, 622, 623, 624, 645, 625, 628, 646, 629, 631, 647, 648, 632, 633, 634, 635, 636, 637, 638, 638, 639, 650, 640, 642, 652, 643, 644, 654, 1098, 656, 659, 645, 1087, 1085, 646, 660, 661, 647, 648, 663, 664, 665, 667, 668, 670, 671, 672, 673, 650, 651, 674, 652, 675, 651, 654, 651, 656, 659, 676, 651, 651, 677, 660, 661, 678, 651, 663, 664, 665, 667, 668, 670, 671, 672, 673, 680, 651, 674, 682, 675, 651, 683, 651, 685, 689, 676, 651, 651, 677, 690, 691, 678, 651, 692, 693, 696, 697, 698, 699, 700, 702, 703, 680, 704, 705, 682, 697, 706, 683, 707, 685, 689, 708, 709, 710, 711, 690, 691, 712, 713, 692, 693, 696, 697, 698, 699, 700, 702, 703, 714, 704, 705, 715, 697, 706, 716, 707, 717, 718, 708, 709, 710, 711, 719, 720, 712, 713, 721, 722, 723, 724, 725, 726, 727, 728, 729, 714, 730, 731, 715, 733, 734, 716, 737, 717, 718, 738, 740, 741, 744, 719, 720, 745, 746, 721, 722, 723, 724, 725, 726, 727, 728, 729, 747, 730, 731, 748, 733, 734, 749, 737, 750, 751, 738, 740, 741, 744, 752, 753, 745, 746, 754, 755, 756, 757, 758, 759, 760, 762, 763, 747, 764, 766, 748, 767, 768, 749, 769, 750, 751, 770, 771, 772, 773, 752, 753, 774, 775, 754, 755, 756, 757, 758, 759, 760, 762, 763, 776, 764, 766, 777, 767, 768, 778, 769, 779, 786, 770, 771, 772, 773, 787, 789, 774, 775, 793, 796, 800, 801, 802, 803, 806, 807, 808, 776, 809, 812, 777, 811, 814, 778, 815, 779, 786, 816, 817, 819, 820, 787, 789, 821, 811, 793, 796, 800, 801, 802, 803, 806, 807, 808, 822, 809, 812, 813, 811, 814, 823, 815, 813, 824, 816, 817, 819, 820, 825, 826, 821, 811, 827, 828, 813, 829, 830, 831, 832, 833, 835, 822, 836, 837, 813, 838, 839, 823, 840, 813, 824, 841, 842, 843, 844, 825, 826, 846, 847, 827, 828, 813, 829, 830, 831, 832, 833, 835, 848, 836, 837, 849, 838, 839, 851, 840, 853, 854, 841, 842, 843, 844, 855, 856, 846, 847, 857, 859, 860, 861, 862, 864, 865, 866, 868, 848, 870, 872, 849, 873, 862, 851, 874, 853, 854, 875, 877, 878, 879, 855, 856, 880, 881, 857, 859, 860, 861, 862, 864, 865, 866, 868, 882, 870, 872, 883, 873, 862, 884, 874, 885, 886, 875, 877, 878, 879, 887, 888, 880, 881, 889, 891, 892, 893, 894, 895, 896, 897, 898, 882, 899, 900, 883, 901, 902, 884, 903, 885, 886, 904, 905, 906, 908, 887, 888, 909, 910, 889, 891, 892, 893, 894, 895, 896, 897, 898, 911, 899, 900, 912, 901, 902, 913, 903, 914, 918, 904, 905, 906, 908, 919, 924, 909, 910, 925, 926, 927, 928, 929, 930, 931, 932, 933, 911, 934, 936, 912, 937, 938, 913, 939, 914, 918, 940, 941, 942, 944, 919, 924, 945, 946, 925, 926, 927, 928, 929, 930, 931, 932, 933, 947, 934, 936, 948, 937, 938, 951, 939, 952, 954, 940, 941, 942, 944, 950, 955, 945, 946, 950, 957, 958, 960, 961, 963, 964, 1065, 968, 947, 969, 973, 948, 974, 975, 951, 976, 952, 954, 977, 979, 980, 981, 950, 955, 967, 982, 950, 957, 958, 960, 961, 963, 964, 967, 968, 985, 969, 973, 987, 974, 975, 967, 976, 989, 990, 977, 979, 980, 981, 994, 995, 967, 982, 996, 997, 998, 999, 1000, 1001, 1002, 967, 1003, 985, 1004, 1005, 987, 1006, 1007, 967, 1008, 989, 990, 1009, 1010, 1011, 1012, 994, 995, 1013, 1014, 996, 997, 998, 999, 1000, 1001, 1002, 1015, 1003, 1016, 1004, 1005, 1017, 1006, 1007, 1018, 1008, 1019, 1020, 1009, 1010, 1011, 1012, 1021, 1023, 1013, 1014, 1024, 1029, 1030, 1031, 1032, 1033, 1034, 1015, 1035, 1016, 1036, 1037, 1017, 1038, 1039, 1018, 1040, 1019, 1020, 1041, 1042, 1043, 1044, 1021, 1023, 1045, 1046, 1024, 1029, 1030, 1031, 1032, 1033, 1034, 1048, 1035, 1049, 1036, 1037, 1050, 1038, 1039, 1051, 1040, 1052, 1053, 1041, 1042, 1043, 1044, 1054, 1055, 1045, 1046, 1057, 1058, 1059, 1060, 1062, 1063, 1066, 1048, 1067, 1049, 1068, 1070, 1050, 1071, 1073, 1051, 1074, 1052, 1053, 1075, 1077, 1078, 1079, 1054, 1055, 1081, 1082, 1057, 1058, 1059, 1060, 1062, 1063, 1066, 1083, 1067, 1084, 1068, 1070, 1086, 1071, 1073, 1088, 1074, 1089, 1090, 1075, 1077, 1078, 1079, 1091, 1092, 1081, 1082, 1093, 1095, 1096, 1097, 1099, 1102, 1105, 1083, 1106, 1084, 1107, 1110, 1086, 1111, 1113, 1088, 1114, 1089, 1090, 1115, 1116, 1117, 1118, 1091, 1092, 1119, 1120, 1093, 1095, 1096, 1097, 1099, 1102, 1105, 1121, 1106, 1122, 1107, 1110, 1123, 1111, 1113, 1124, 1114, 1125, 1126, 1115, 1116, 1117, 1118, 1127, 1128, 1119, 1120, 1129, 1130, 1133, 1134, 1135, 1137, 1138, 1121, 1139, 1122, 1140, 1141, 1123, 1142, 1144, 1124, 1145, 1125, 1126, 1146, 1147, 1148, 1149, 1127, 1128, 1153, 1154, 1129, 1130, 1133, 1134, 1135, 1137, 1138, 1154, 1139, 1155, 1140, 1141, 1156, 1142, 1144, 1157, 1145, 1158, 1159, 1146, 1147, 1148, 1149, 1160, 1161, 1153, 1154, 1164, 1166, 1167, 1168, 1170, 1171, 1172, 1173, 1159, 1155, 1174, 1175, 1156, 1176, 1177, 1157, 1178, 1158, 1159, 1179, 1180, 1181, 1178, 1160, 1161, 1183, 1188, 1164, 1166, 1167, 1168, 1170, 1171, 1172, 1173, 1159, 1189, 1174, 1175, 1190, 1176, 1177, 1191, 1178, 1192, 1193, 1179, 1180, 1181, 1178, 1194, 1195, 1183, 1188, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1189, 1205, 1206, 1190, 1207, 1208, 1191, 1209, 1192, 1193, 1211, 1212, 1213, 1214, 1194, 1195, 1215, 1216, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1217, 1205, 1206, 1218, 1207, 1208, 1219, 1209, 1220, 1223, 1211, 1212, 1213, 1214, 1224, 1227, 1215, 1216, 1228, 1229, 1232, 1233, 1234, 1235, 1237, 1238, 1239, 1217, 1242, 1243, 1218, 1244, 1246, 1219, 1247, 1220, 1223, 1248, 1249, 1250, 1251, 1224, 1227, 1252, 1253, 1228, 1229, 1232, 1233, 1234, 1235, 1237, 1238, 1239, 1257, 1242, 1243, 1258, 1244, 1246, 1259, 1247, 1260, 1262, 1248, 1249, 1250, 1251, 1263, 1264, 1252, 1253, 1265, 1266, 1267, 1268, 1271, 1272, 1273, 1274, 1276, 1257, 1277, 1283, 1258, 1284, 1287, 1259, 1288, 1260, 1262, 1289, 1291, 1292, 1293, 1263, 1264, 1294, 1296, 1265, 1266, 1267, 1268, 1271, 1272, 1273, 1274, 1276, 1298, 1277, 1283, 1299, 1284, 1287, 1301, 1288, 1303, 1304, 1289, 1291, 1292, 1293, 1306, 1307, 1294, 1296, 1308, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1318, 1298, 1319, 1321, 1299, 1322, 1324, 1301, 1325, 1303, 1304, 1327, 1329, 1330, 1331, 1306, 1307, 1332, 1333, 1308, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1318, 1334, 1319, 1321, 1337, 1322, 1324, 1338, 1325, 1339, 1340, 1327, 1329, 1330, 1331, 1341, 1342, 1332, 1333, 1343, 1344, 1345, 1346, 1347, 1348, 1351, 1354, 1355, 1334, 1358, 1359, 1337, 1360, 1361, 1338, 1361, 1339, 1340, 1362, 1364, 1367, 1368, 1341, 1342, 1370, 1372, 1343, 1344, 1345, 1346, 1347, 1348, 1351, 1354, 1355, 1373, 1358, 1359, 1374, 1360, 1361, 1375, 1361, 1376, 1377, 1362, 1364, 1367, 1368, 1378, 1379, 1370, 1372, 1380, 1381, 1378, 1382, 1383, 1384, 1385, 1386, 1387, 1373, 1389, 1390, 1374, 1392, 1393, 1375, 1394, 1376, 1377, 1396, 1397, 1398, 1399, 1378, 1379, 1400, 1401, 1380, 1381, 1378, 1382, 1383, 1384, 1385, 1386, 1387, 1402, 1389, 1390, 1403, 1392, 1393, 1404, 1394, 1405, 1408, 1396, 1397, 1398, 1399, 1410, 1411, 1400, 1401, 1412, 1413, 1414, 1415, 1416, 1418, 1419, 1420, 1423, 1402, 1424, 1427, 1403, 1428, 1429, 1404, 1430, 1405, 1408, 1432, 1434, 1435, 1437, 1410, 1411, 1438, 1439, 1412, 1413, 1414, 1415, 1416, 1418, 1419, 1420, 1423, 1441, 1424, 1427, 1444, 1428, 1429, 1445, 1430, 1446, 1447, 1432, 1434, 1435, 1437, 1448, 1449, 1438, 1439, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1459, 1460, 1441, 1461, 1462, 1444, 1463, 1464, 1445, 1465, 1446, 1447, 1466, 1468, 1469, 1471, 1448, 1449, 1472, 1473, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1459, 1460, 1474, 1461, 1462, 1477, 1463, 1464, 1478, 1465, 1480, 1483, 1466, 1468, 1469, 1471, 1484, 1485, 1472, 1473, 1486, 1487, 1488, 1489, 1491, 1492, 1493, 1494, 1495, 1474, 1496, 1497, 1477, 1498, 1499, 1478, 1500, 1480, 1483, 1501, 1502, 1503, 1504, 1484, 1485, 1505, 1506, 1486, 1487, 1488, 1489, 1491, 1492, 1493, 1494, 1495, 1507, 1496, 1497, 1508, 1498, 1499, 1509, 1500, 1510, 1511, 1501, 1502, 1503, 1504, 1512, 1513, 1505, 1506, 1514, 1515, 1516, 1517, 1518, 1520, 1528, 1529, 1530, 1507, 1531, 1533, 1508, 1535, 1536, 1509, 1538, 1510, 1511, 1539, 1540, 1541, 1542, 1512, 1513, 1545, 1547, 1514, 1515, 1516, 1517, 1518, 1520, 1528, 1529, 1530, 1548, 1531, 1533, 1549, 1535, 1536, 1550, 1538, 1550, 1551, 1539, 1540, 1541, 1542, 1552, 1554, 1545, 1547, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1548, 1565, 1566, 1549, 1567, 1569, 1550, 1570, 1550, 1551, 1571, 1572, 1573, 1576, 1552, 1554, 1577, 1578, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1579, 1565, 1566, 1582, 1567, 1569, 1583, 1570, 1584, 1587, 1571, 1572, 1573, 1576, 1588, 1589, 1577, 1578, 1590, 1591, 1592, 1594, 1595, 1597, 1599, 1600, 1603, 1579, 1604, 1605, 1582, 1608, 1609, 1583, 1610, 1584, 1587, 1611, 1612, 1614, 1616, 1588, 1589, 1617, 1619, 1590, 1591, 1592, 1594, 1595, 1597, 1599, 1600, 1603, 1620, 1604, 1605, 1621, 1608, 1609, 1622, 1610, 1623, 1625, 1611, 1612, 1614, 1616, 1064, 1061, 1617, 1619, 1028, 1027, 1026, 1025, 986, 984, 983, 978, 970, 1620, 962, 953, 1621, 949, 943, 1622, 922, 1623, 1625, 1630, 1630, 921, 920, 917, 916, 907, 890, 852, 810, 798, 790, 788, 785, 784, 783, 782, 781, 780, 743, 742, 739, 694, 688, 687, 686, 684, 655, 653, 649, 626, 613, 572, 568, 566, 564, 559, 556, 537, 529, 513, 507, 504, 481, 451, 449, 448, 433, 414, 394, 379, 378, 373, 361, 351, 348, 338, 323, 319, 317, 309, 290, 277, 268, 226, 196, 181, 144, 124, 37, 5, 3, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected static int yy_more_flag = 0; static int yy_more_len = 0; #define yymore() ((yy_more_flag) = 1) #define YY_MORE_ADJ (yy_more_len) #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "conf_lexer.l" /* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * conf_lexer.l: Scans the ircd configuration file for tokens. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: conf_lexer.c 2284 2013-06-18 19:16:46Z michael $ */ #line 31 "conf_lexer.l" #include "stdinc.h" #include "irc_string.h" #include "conf.h" #include "conf_parser.h" /* autogenerated header file */ #include "log.h" #undef YY_INPUT #define YY_FATAL_ERROR(msg) conf_yy_fatal_error(msg) #define YY_INPUT(buf,result,max_size) \ if (!(result = conf_yy_input(buf, max_size))) \ YY_FATAL_ERROR("input in flex scanner failed"); #define MAX_INCLUDE_DEPTH 10 unsigned int lineno = 1; char linebuf[IRCD_BUFSIZE]; char conffilebuf[IRCD_BUFSIZE]; static int include_stack_ptr = 0; static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static unsigned int lineno_stack[MAX_INCLUDE_DEPTH]; static FILE *inc_fbfile_in[MAX_INCLUDE_DEPTH]; static char conffile_stack[MAX_INCLUDE_DEPTH][IRCD_BUFSIZE]; static void ccomment(void); static void cinclude(void); static int ieof(void); static int conf_yy_input(char *lbuf, unsigned int max_size) { return !fgets(lbuf, max_size, conf_parser_ctx.conf_file) ? 0 : strlen(lbuf); } static int conf_yy_fatal_error(const char *msg) { return 0; } #line 1763 "conf_lexer.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 78 "conf_lexer.l" #line 1945 "conf_lexer.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { (yy_more_len) = 0; if ( (yy_more_flag) ) { (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); (yy_more_flag) = 0; } yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1629 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_current_state != 1628 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 79 "conf_lexer.l" { cinclude(); } YY_BREAK case 2: YY_RULE_SETUP #line 80 "conf_lexer.l" { ccomment(); } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP #line 82 "conf_lexer.l" { strlcpy(linebuf, yytext+1, sizeof(linebuf)); ++lineno; yyless(1); } YY_BREAK case 4: YY_RULE_SETUP #line 84 "conf_lexer.l" ; YY_BREAK case 5: YY_RULE_SETUP #line 85 "conf_lexer.l" ; YY_BREAK case 6: YY_RULE_SETUP #line 87 "conf_lexer.l" { yylval.number = atoi(yytext); return NUMBER; } YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP #line 89 "conf_lexer.l" { if (yytext[yyleng-2] == '\\') { yyless(yyleng-1); /* return last quote */ yymore(); /* append next string */ } else { yylval.string = yytext+1; if(yylval.string[yyleng-2] != '"') ilog(LOG_TYPE_IRCD, "Unterminated character string"); else { int i,j; yylval.string[yyleng-2] = '\0'; /* remove close * quote */ for (j=i=0 ;yylval.string[i] != '\0'; i++,j++) { if (yylval.string[i] != '\\') { yylval.string[j] = yylval.string[i]; } else { i++; if (yylval.string[i] == '\0') /* XXX * should not * happen */ { ilog(LOG_TYPE_IRCD, "Unterminated character string"); break; } yylval.string[j] = yylval.string[i]; } } yylval.string[j] = '\0'; return QSTRING; } } } YY_BREAK case 8: YY_RULE_SETUP #line 134 "conf_lexer.l" { return ACCEPT_PASSWORD; } YY_BREAK case 9: YY_RULE_SETUP #line 135 "conf_lexer.l" { return ADMIN; } YY_BREAK case 10: YY_RULE_SETUP #line 136 "conf_lexer.l" { return ADMIN; } YY_BREAK case 11: YY_RULE_SETUP #line 137 "conf_lexer.l" { return AFTYPE; } YY_BREAK case 12: YY_RULE_SETUP #line 138 "conf_lexer.l" { return T_ALL; } YY_BREAK case 13: YY_RULE_SETUP #line 139 "conf_lexer.l" { return ANTI_NICK_FLOOD; } YY_BREAK case 14: YY_RULE_SETUP #line 140 "conf_lexer.l" { return ANTI_SPAM_EXIT_MESSAGE_TIME; } YY_BREAK case 15: YY_RULE_SETUP #line 141 "conf_lexer.l" { return IRCD_AUTH; } YY_BREAK case 16: YY_RULE_SETUP #line 142 "conf_lexer.l" { return AUTOCONN; } YY_BREAK case 17: YY_RULE_SETUP #line 143 "conf_lexer.l" { return T_BOTS; } YY_BREAK case 18: YY_RULE_SETUP #line 144 "conf_lexer.l" { return CALLER_ID_WAIT; } YY_BREAK case 19: YY_RULE_SETUP #line 145 "conf_lexer.l" { return T_CALLERID; } YY_BREAK case 20: YY_RULE_SETUP #line 146 "conf_lexer.l" { return CAN_FLOOD; } YY_BREAK case 21: YY_RULE_SETUP #line 147 "conf_lexer.l" { return T_CCONN; } YY_BREAK case 22: YY_RULE_SETUP #line 148 "conf_lexer.l" { return CHANNEL; } YY_BREAK case 23: YY_RULE_SETUP #line 149 "conf_lexer.l" { return CIDR_BITLEN_IPV4; } YY_BREAK case 24: YY_RULE_SETUP #line 150 "conf_lexer.l" { return CIDR_BITLEN_IPV6; } YY_BREAK case 25: YY_RULE_SETUP #line 151 "conf_lexer.l" { return CLASS; } YY_BREAK case 26: YY_RULE_SETUP #line 152 "conf_lexer.l" { return T_CLUSTER; } YY_BREAK case 27: YY_RULE_SETUP #line 153 "conf_lexer.l" { return CONNECT; } YY_BREAK case 28: YY_RULE_SETUP #line 154 "conf_lexer.l" { return CONNECTFREQ; } YY_BREAK case 29: YY_RULE_SETUP #line 155 "conf_lexer.l" { return CYCLE_ON_HOST_CHANGE; } YY_BREAK case 30: YY_RULE_SETUP #line 156 "conf_lexer.l" { return T_DEAF; } YY_BREAK case 31: YY_RULE_SETUP #line 157 "conf_lexer.l" { return T_DEBUG; } YY_BREAK case 32: YY_RULE_SETUP #line 158 "conf_lexer.l" { return DEFAULT_FLOODCOUNT; } YY_BREAK case 33: YY_RULE_SETUP #line 159 "conf_lexer.l" { return DEFAULT_SPLIT_SERVER_COUNT; } YY_BREAK case 34: YY_RULE_SETUP #line 160 "conf_lexer.l" { return DEFAULT_SPLIT_USER_COUNT; } YY_BREAK case 35: YY_RULE_SETUP #line 161 "conf_lexer.l" { return DENY; } YY_BREAK case 36: YY_RULE_SETUP #line 162 "conf_lexer.l" { return DESCRIPTION; } YY_BREAK case 37: YY_RULE_SETUP #line 163 "conf_lexer.l" { return DIE; } YY_BREAK case 38: YY_RULE_SETUP #line 164 "conf_lexer.l" { return DISABLE_AUTH; } YY_BREAK case 39: YY_RULE_SETUP #line 165 "conf_lexer.l" { return DISABLE_FAKE_CHANNELS; } YY_BREAK case 40: YY_RULE_SETUP #line 166 "conf_lexer.l" { return DISABLE_REMOTE_COMMANDS; } YY_BREAK case 41: YY_RULE_SETUP #line 167 "conf_lexer.l" { return T_DLINE; } YY_BREAK case 42: YY_RULE_SETUP #line 168 "conf_lexer.l" { return DOTS_IN_IDENT; } YY_BREAK case 43: YY_RULE_SETUP #line 169 "conf_lexer.l" { return EGDPOOL_PATH; } YY_BREAK case 44: YY_RULE_SETUP #line 170 "conf_lexer.l" { return EMAIL; } YY_BREAK case 45: YY_RULE_SETUP #line 171 "conf_lexer.l" { return ENCRYPTED; } YY_BREAK case 46: YY_RULE_SETUP #line 172 "conf_lexer.l" { return EXCEED_LIMIT; } YY_BREAK case 47: YY_RULE_SETUP #line 173 "conf_lexer.l" { return EXEMPT; } YY_BREAK case 48: YY_RULE_SETUP #line 174 "conf_lexer.l" { return T_EXTERNAL; } YY_BREAK case 49: YY_RULE_SETUP #line 175 "conf_lexer.l" { return FAILED_OPER_NOTICE; } YY_BREAK case 50: YY_RULE_SETUP #line 176 "conf_lexer.l" { return T_FARCONNECT; } YY_BREAK case 51: YY_RULE_SETUP #line 177 "conf_lexer.l" { return T_FILE; } YY_BREAK case 52: YY_RULE_SETUP #line 178 "conf_lexer.l" { return IRCD_FLAGS; } YY_BREAK case 53: YY_RULE_SETUP #line 179 "conf_lexer.l" { return FLATTEN_LINKS; } YY_BREAK case 54: YY_RULE_SETUP #line 180 "conf_lexer.l" { return T_FULL; } YY_BREAK case 55: YY_RULE_SETUP #line 181 "conf_lexer.l" { return GECOS; } YY_BREAK case 56: YY_RULE_SETUP #line 182 "conf_lexer.l" { return GENERAL; } YY_BREAK case 57: YY_RULE_SETUP #line 183 "conf_lexer.l" { return GLINE; } YY_BREAK case 58: YY_RULE_SETUP #line 184 "conf_lexer.l" { return GLINE_DURATION; } YY_BREAK case 59: YY_RULE_SETUP #line 185 "conf_lexer.l" { return GLINE_ENABLE; } YY_BREAK case 60: YY_RULE_SETUP #line 186 "conf_lexer.l" { return GLINE_EXEMPT; } YY_BREAK case 61: YY_RULE_SETUP #line 187 "conf_lexer.l" { return GLINE_MIN_CIDR; } YY_BREAK case 62: YY_RULE_SETUP #line 188 "conf_lexer.l" { return GLINE_MIN_CIDR6; } YY_BREAK case 63: YY_RULE_SETUP #line 189 "conf_lexer.l" { return GLINE_REQUEST_DURATION; } YY_BREAK case 64: YY_RULE_SETUP #line 190 "conf_lexer.l" { return GLOBAL_KILL; } YY_BREAK case 65: YY_RULE_SETUP #line 191 "conf_lexer.l" { return T_GLOBOPS; } YY_BREAK case 66: YY_RULE_SETUP #line 192 "conf_lexer.l" { return NEED_IDENT; } YY_BREAK case 67: YY_RULE_SETUP #line 193 "conf_lexer.l" { return HAVENT_READ_CONF; } YY_BREAK case 68: YY_RULE_SETUP #line 194 "conf_lexer.l" { return HIDDEN; } YY_BREAK case 69: YY_RULE_SETUP #line 195 "conf_lexer.l" { return HIDDEN_NAME; } YY_BREAK case 70: YY_RULE_SETUP #line 196 "conf_lexer.l" { return HIDE_IDLE_FROM_OPERS; } YY_BREAK case 71: YY_RULE_SETUP #line 197 "conf_lexer.l" { return HIDE_SERVER_IPS; } YY_BREAK case 72: YY_RULE_SETUP #line 198 "conf_lexer.l" { return HIDE_SERVERS; } YY_BREAK case 73: YY_RULE_SETUP #line 199 "conf_lexer.l" { return HIDE_SERVICES; } YY_BREAK case 74: YY_RULE_SETUP #line 200 "conf_lexer.l" { return HIDE_SPOOF_IPS; } YY_BREAK case 75: YY_RULE_SETUP #line 201 "conf_lexer.l" { return HOST; } YY_BREAK case 76: YY_RULE_SETUP #line 202 "conf_lexer.l" { return HUB; } YY_BREAK case 77: YY_RULE_SETUP #line 203 "conf_lexer.l" { return HUB_MASK; } YY_BREAK case 78: YY_RULE_SETUP #line 204 "conf_lexer.l" { return IGNORE_BOGUS_TS; } YY_BREAK case 79: YY_RULE_SETUP #line 205 "conf_lexer.l" { return T_INVISIBLE; } YY_BREAK case 80: YY_RULE_SETUP #line 206 "conf_lexer.l" { return INVISIBLE_ON_CONNECT; } YY_BREAK case 81: YY_RULE_SETUP #line 207 "conf_lexer.l" { return IP; } YY_BREAK case 82: YY_RULE_SETUP #line 208 "conf_lexer.l" { return T_IPV4; } YY_BREAK case 83: YY_RULE_SETUP #line 209 "conf_lexer.l" { return T_IPV6; } YY_BREAK case 84: YY_RULE_SETUP #line 210 "conf_lexer.l" { return JOIN_FLOOD_COUNT; } YY_BREAK case 85: YY_RULE_SETUP #line 211 "conf_lexer.l" { return JOIN_FLOOD_TIME; } YY_BREAK case 86: YY_RULE_SETUP #line 212 "conf_lexer.l" { return KILL; } YY_BREAK case 87: YY_RULE_SETUP #line 213 "conf_lexer.l" { return KILL_CHASE_TIME_LIMIT; } YY_BREAK case 88: YY_RULE_SETUP #line 214 "conf_lexer.l" { return KLINE; } YY_BREAK case 89: YY_RULE_SETUP #line 215 "conf_lexer.l" { return KLINE_EXEMPT; } YY_BREAK case 90: YY_RULE_SETUP #line 216 "conf_lexer.l" { return KNOCK_DELAY; } YY_BREAK case 91: YY_RULE_SETUP #line 217 "conf_lexer.l" { return KNOCK_DELAY_CHANNEL; } YY_BREAK case 92: YY_RULE_SETUP #line 218 "conf_lexer.l" { return LEAF_MASK; } YY_BREAK case 93: YY_RULE_SETUP #line 219 "conf_lexer.l" { return LINKS_DELAY; } YY_BREAK case 94: YY_RULE_SETUP #line 220 "conf_lexer.l" { return LISTEN; } YY_BREAK case 95: YY_RULE_SETUP #line 221 "conf_lexer.l" { return T_LOCOPS; } YY_BREAK case 96: YY_RULE_SETUP #line 222 "conf_lexer.l" { return T_LOG; } YY_BREAK case 97: YY_RULE_SETUP #line 223 "conf_lexer.l" { return MASK; } YY_BREAK case 98: YY_RULE_SETUP #line 224 "conf_lexer.l" { return TMASKED; } YY_BREAK case 99: YY_RULE_SETUP #line 225 "conf_lexer.l" { return MAX_ACCEPT; } YY_BREAK case 100: YY_RULE_SETUP #line 226 "conf_lexer.l" { return MAX_BANS; } YY_BREAK case 101: YY_RULE_SETUP #line 227 "conf_lexer.l" { return MAX_CHANS_PER_OPER; } YY_BREAK case 102: YY_RULE_SETUP #line 228 "conf_lexer.l" { return MAX_CHANS_PER_USER; } YY_BREAK case 103: YY_RULE_SETUP #line 229 "conf_lexer.l" { return T_MAX_CLIENTS; } YY_BREAK case 104: YY_RULE_SETUP #line 230 "conf_lexer.l" { return MAX_GLOBAL; } YY_BREAK case 105: YY_RULE_SETUP #line 231 "conf_lexer.l" { return MAX_IDENT; } YY_BREAK case 106: YY_RULE_SETUP #line 232 "conf_lexer.l" { return MAX_IDLE; } YY_BREAK case 107: YY_RULE_SETUP #line 233 "conf_lexer.l" { return MAX_LOCAL; } YY_BREAK case 108: YY_RULE_SETUP #line 234 "conf_lexer.l" { return MAX_NICK_CHANGES; } YY_BREAK case 109: YY_RULE_SETUP #line 235 "conf_lexer.l" { return MAX_NICK_LENGTH; } YY_BREAK case 110: YY_RULE_SETUP #line 236 "conf_lexer.l" { return MAX_NICK_TIME; } YY_BREAK case 111: YY_RULE_SETUP #line 237 "conf_lexer.l" { return MAX_NUMBER; } YY_BREAK case 112: YY_RULE_SETUP #line 238 "conf_lexer.l" { return MAX_TARGETS; } YY_BREAK case 113: YY_RULE_SETUP #line 239 "conf_lexer.l" { return MAX_TOPIC_LENGTH; } YY_BREAK case 114: YY_RULE_SETUP #line 240 "conf_lexer.l" { return MAX_WATCH; } YY_BREAK case 115: YY_RULE_SETUP #line 241 "conf_lexer.l" { return MIN_IDLE; } YY_BREAK case 116: YY_RULE_SETUP #line 242 "conf_lexer.l" { return MIN_NONWILDCARD; } YY_BREAK case 117: YY_RULE_SETUP #line 243 "conf_lexer.l" { return MIN_NONWILDCARD_SIMPLE; } YY_BREAK case 118: YY_RULE_SETUP #line 244 "conf_lexer.l" { return MODULE; } YY_BREAK case 119: YY_RULE_SETUP #line 245 "conf_lexer.l" { return MODULES; } YY_BREAK case 120: YY_RULE_SETUP #line 246 "conf_lexer.l" { return MOTD; } YY_BREAK case 121: YY_RULE_SETUP #line 247 "conf_lexer.l" { return NAME; } YY_BREAK case 122: YY_RULE_SETUP #line 248 "conf_lexer.l" { return T_NCHANGE; } YY_BREAK case 123: YY_RULE_SETUP #line 249 "conf_lexer.l" { return NEED_IDENT; } YY_BREAK case 124: YY_RULE_SETUP #line 250 "conf_lexer.l" { return NEED_PASSWORD; } YY_BREAK case 125: YY_RULE_SETUP #line 251 "conf_lexer.l" { return NETWORK_DESC; } YY_BREAK case 126: YY_RULE_SETUP #line 252 "conf_lexer.l" { return NETWORK_NAME; } YY_BREAK case 127: YY_RULE_SETUP #line 253 "conf_lexer.l" { return NICK; } YY_BREAK case 128: YY_RULE_SETUP #line 254 "conf_lexer.l" { return NO_CREATE_ON_SPLIT; } YY_BREAK case 129: YY_RULE_SETUP #line 255 "conf_lexer.l" { return NO_JOIN_ON_SPLIT; } YY_BREAK case 130: YY_RULE_SETUP #line 256 "conf_lexer.l" { return NO_OPER_FLOOD; } YY_BREAK case 131: YY_RULE_SETUP #line 257 "conf_lexer.l" { return NO_TILDE; } YY_BREAK case 132: YY_RULE_SETUP #line 258 "conf_lexer.l" { return T_NONONREG; } YY_BREAK case 133: YY_RULE_SETUP #line 259 "conf_lexer.l" { return NUMBER_PER_CIDR; } YY_BREAK case 134: YY_RULE_SETUP #line 260 "conf_lexer.l" { return NUMBER_PER_IP; } YY_BREAK case 135: YY_RULE_SETUP #line 261 "conf_lexer.l" { return OPERATOR; } YY_BREAK case 136: YY_RULE_SETUP #line 262 "conf_lexer.l" { return OPER_ONLY_UMODES; } YY_BREAK case 137: YY_RULE_SETUP #line 263 "conf_lexer.l" { return OPER_PASS_RESV; } YY_BREAK case 138: YY_RULE_SETUP #line 264 "conf_lexer.l" { return OPER_UMODES; } YY_BREAK case 139: YY_RULE_SETUP #line 265 "conf_lexer.l" { return OPERATOR; } YY_BREAK case 140: YY_RULE_SETUP #line 266 "conf_lexer.l" { return OPERS_BYPASS_CALLERID; } YY_BREAK case 141: YY_RULE_SETUP #line 267 "conf_lexer.l" { return T_OPERWALL; } YY_BREAK case 142: YY_RULE_SETUP #line 268 "conf_lexer.l" { return PACE_WAIT; } YY_BREAK case 143: YY_RULE_SETUP #line 269 "conf_lexer.l" { return PACE_WAIT_SIMPLE; } YY_BREAK case 144: YY_RULE_SETUP #line 270 "conf_lexer.l" { return PASSWORD; } YY_BREAK case 145: YY_RULE_SETUP #line 271 "conf_lexer.l" { return PASSWORD; } YY_BREAK case 146: YY_RULE_SETUP #line 272 "conf_lexer.l" { return PATH; } YY_BREAK case 147: YY_RULE_SETUP #line 273 "conf_lexer.l" { return PING_COOKIE; } YY_BREAK case 148: YY_RULE_SETUP #line 274 "conf_lexer.l" { return PING_TIME; } YY_BREAK case 149: YY_RULE_SETUP #line 275 "conf_lexer.l" { return PORT; } YY_BREAK case 150: YY_RULE_SETUP #line 276 "conf_lexer.l" { return RESV; } YY_BREAK case 151: YY_RULE_SETUP #line 277 "conf_lexer.l" { return RANDOM_IDLE; } YY_BREAK case 152: YY_RULE_SETUP #line 278 "conf_lexer.l" { return REASON; } YY_BREAK case 153: YY_RULE_SETUP #line 279 "conf_lexer.l" { return T_RECVQ; } YY_BREAK case 154: YY_RULE_SETUP #line 280 "conf_lexer.l" { return REDIRPORT; } YY_BREAK case 155: YY_RULE_SETUP #line 281 "conf_lexer.l" { return REDIRSERV; } YY_BREAK case 156: YY_RULE_SETUP #line 282 "conf_lexer.l" { return REHASH; } YY_BREAK case 157: YY_RULE_SETUP #line 283 "conf_lexer.l" { return T_REJ; } YY_BREAK case 158: YY_RULE_SETUP #line 284 "conf_lexer.l" { return REMOTE; } YY_BREAK case 159: YY_RULE_SETUP #line 285 "conf_lexer.l" { return REMOTEBAN; } YY_BREAK case 160: YY_RULE_SETUP #line 286 "conf_lexer.l" { return T_RESTART; } YY_BREAK case 161: YY_RULE_SETUP #line 287 "conf_lexer.l" { return RESV; } YY_BREAK case 162: YY_RULE_SETUP #line 288 "conf_lexer.l" { return RESV_EXEMPT; } YY_BREAK case 163: YY_RULE_SETUP #line 289 "conf_lexer.l" { return RSA_PRIVATE_KEY_FILE; } YY_BREAK case 164: YY_RULE_SETUP #line 290 "conf_lexer.l" { return RSA_PUBLIC_KEY_FILE; } YY_BREAK case 165: YY_RULE_SETUP #line 291 "conf_lexer.l" { return SEND_PASSWORD; } YY_BREAK case 166: YY_RULE_SETUP #line 292 "conf_lexer.l" { return SENDQ; } YY_BREAK case 167: YY_RULE_SETUP #line 293 "conf_lexer.l" { return T_SERVER; } YY_BREAK case 168: YY_RULE_SETUP #line 294 "conf_lexer.l" { return SERVERHIDE; } YY_BREAK case 169: YY_RULE_SETUP #line 295 "conf_lexer.l" { return SERVERINFO; } YY_BREAK case 170: YY_RULE_SETUP #line 296 "conf_lexer.l" { return T_SERVICE; } YY_BREAK case 171: YY_RULE_SETUP #line 297 "conf_lexer.l" { return T_SERVICES_NAME; } YY_BREAK case 172: YY_RULE_SETUP #line 298 "conf_lexer.l" { return T_SERVNOTICE; } YY_BREAK case 173: YY_RULE_SETUP #line 299 "conf_lexer.l" { return T_SET; } YY_BREAK case 174: YY_RULE_SETUP #line 300 "conf_lexer.l" { return T_SHARED; } YY_BREAK case 175: YY_RULE_SETUP #line 301 "conf_lexer.l" { return SHORT_MOTD; } YY_BREAK case 176: YY_RULE_SETUP #line 302 "conf_lexer.l" { return IRCD_SID; } YY_BREAK case 177: YY_RULE_SETUP #line 303 "conf_lexer.l" { return T_SIZE; } YY_BREAK case 178: YY_RULE_SETUP #line 304 "conf_lexer.l" { return T_SKILL; } YY_BREAK case 179: YY_RULE_SETUP #line 305 "conf_lexer.l" { return T_SOFTCALLERID; } YY_BREAK case 180: YY_RULE_SETUP #line 306 "conf_lexer.l" { return SPOOF; } YY_BREAK case 181: YY_RULE_SETUP #line 307 "conf_lexer.l" { return SPOOF_NOTICE; } YY_BREAK case 182: YY_RULE_SETUP #line 308 "conf_lexer.l" { return T_SPY; } YY_BREAK case 183: YY_RULE_SETUP #line 309 "conf_lexer.l" { return SQUIT; } YY_BREAK case 184: YY_RULE_SETUP #line 310 "conf_lexer.l" { return T_SSL; } YY_BREAK case 185: YY_RULE_SETUP #line 311 "conf_lexer.l" { return SSL_CERTIFICATE_FILE; } YY_BREAK case 186: YY_RULE_SETUP #line 312 "conf_lexer.l" { return SSL_CERTIFICATE_FINGERPRINT; } YY_BREAK case 187: YY_RULE_SETUP #line 313 "conf_lexer.l" { return T_SSL_CIPHER_LIST; } YY_BREAK case 188: YY_RULE_SETUP #line 314 "conf_lexer.l" { return T_SSL_CLIENT_METHOD; } YY_BREAK case 189: YY_RULE_SETUP #line 315 "conf_lexer.l" { return SSL_CONNECTION_REQUIRED; } YY_BREAK case 190: YY_RULE_SETUP #line 316 "conf_lexer.l" { return SSL_DH_PARAM_FILE; } YY_BREAK case 191: YY_RULE_SETUP #line 317 "conf_lexer.l" { return T_SSL_SERVER_METHOD; } YY_BREAK case 192: YY_RULE_SETUP #line 318 "conf_lexer.l" { return T_SSLV3; } YY_BREAK case 193: YY_RULE_SETUP #line 319 "conf_lexer.l" { return STATS_E_DISABLED; } YY_BREAK case 194: YY_RULE_SETUP #line 320 "conf_lexer.l" { return STATS_I_OPER_ONLY; } YY_BREAK case 195: YY_RULE_SETUP #line 321 "conf_lexer.l" { return STATS_K_OPER_ONLY; } YY_BREAK case 196: YY_RULE_SETUP #line 322 "conf_lexer.l" { return STATS_O_OPER_ONLY; } YY_BREAK case 197: YY_RULE_SETUP #line 323 "conf_lexer.l" { return STATS_P_OPER_ONLY; } YY_BREAK case 198: YY_RULE_SETUP #line 324 "conf_lexer.l" { return STATS_U_OPER_ONLY; } YY_BREAK case 199: YY_RULE_SETUP #line 325 "conf_lexer.l" { return THROTTLE_TIME; } YY_BREAK case 200: YY_RULE_SETUP #line 326 "conf_lexer.l" { return TKLINE_EXPIRE_NOTICES; } YY_BREAK case 201: YY_RULE_SETUP #line 327 "conf_lexer.l" { return T_TLSV1; } YY_BREAK case 202: YY_RULE_SETUP #line 328 "conf_lexer.l" { return TRUE_NO_OPER_FLOOD; } YY_BREAK case 203: YY_RULE_SETUP #line 329 "conf_lexer.l" { return TS_MAX_DELTA; } YY_BREAK case 204: YY_RULE_SETUP #line 330 "conf_lexer.l" { return TS_WARN_DELTA; } YY_BREAK case 205: YY_RULE_SETUP #line 331 "conf_lexer.l" { return TYPE; } YY_BREAK case 206: YY_RULE_SETUP #line 332 "conf_lexer.l" { return T_UMODES; } YY_BREAK case 207: YY_RULE_SETUP #line 333 "conf_lexer.l" { return T_UNAUTH; } YY_BREAK case 208: YY_RULE_SETUP #line 334 "conf_lexer.l" { return T_UNDLINE; } YY_BREAK case 209: YY_RULE_SETUP #line 335 "conf_lexer.l" { return UNKLINE; } YY_BREAK case 210: YY_RULE_SETUP #line 336 "conf_lexer.l" { return T_UNLIMITED; } YY_BREAK case 211: YY_RULE_SETUP #line 337 "conf_lexer.l" { return T_UNRESV; } YY_BREAK case 212: YY_RULE_SETUP #line 338 "conf_lexer.l" { return T_UNXLINE; } YY_BREAK case 213: YY_RULE_SETUP #line 339 "conf_lexer.l" { return USE_EGD; } YY_BREAK case 214: YY_RULE_SETUP #line 340 "conf_lexer.l" { return USE_LOGGING; } YY_BREAK case 215: YY_RULE_SETUP #line 341 "conf_lexer.l" { return USER; } YY_BREAK case 216: YY_RULE_SETUP #line 342 "conf_lexer.l" { return VHOST; } YY_BREAK case 217: YY_RULE_SETUP #line 343 "conf_lexer.l" { return VHOST6; } YY_BREAK case 218: YY_RULE_SETUP #line 344 "conf_lexer.l" { return T_WALLOP; } YY_BREAK case 219: YY_RULE_SETUP #line 345 "conf_lexer.l" { return T_WALLOPS; } YY_BREAK case 220: YY_RULE_SETUP #line 346 "conf_lexer.l" { return WARN_NO_NLINE; } YY_BREAK case 221: YY_RULE_SETUP #line 347 "conf_lexer.l" { return T_WEBIRC; } YY_BREAK case 222: YY_RULE_SETUP #line 348 "conf_lexer.l" { return XLINE; } YY_BREAK case 223: YY_RULE_SETUP #line 350 "conf_lexer.l" { yylval.number = 1; return TBOOL; } YY_BREAK case 224: YY_RULE_SETUP #line 351 "conf_lexer.l" { yylval.number = 0; return TBOOL; } YY_BREAK case 225: YY_RULE_SETUP #line 353 "conf_lexer.l" { return YEARS; } YY_BREAK case 226: YY_RULE_SETUP #line 354 "conf_lexer.l" { return YEARS; } YY_BREAK case 227: YY_RULE_SETUP #line 355 "conf_lexer.l" { return MONTHS; } YY_BREAK case 228: YY_RULE_SETUP #line 356 "conf_lexer.l" { return MONTHS; } YY_BREAK case 229: YY_RULE_SETUP #line 357 "conf_lexer.l" { return WEEKS; } YY_BREAK case 230: YY_RULE_SETUP #line 358 "conf_lexer.l" { return WEEKS; } YY_BREAK case 231: YY_RULE_SETUP #line 359 "conf_lexer.l" { return DAYS; } YY_BREAK case 232: YY_RULE_SETUP #line 360 "conf_lexer.l" { return DAYS; } YY_BREAK case 233: YY_RULE_SETUP #line 361 "conf_lexer.l" { return HOURS; } YY_BREAK case 234: YY_RULE_SETUP #line 362 "conf_lexer.l" { return HOURS; } YY_BREAK case 235: YY_RULE_SETUP #line 363 "conf_lexer.l" { return MINUTES; } YY_BREAK case 236: YY_RULE_SETUP #line 364 "conf_lexer.l" { return MINUTES; } YY_BREAK case 237: YY_RULE_SETUP #line 365 "conf_lexer.l" { return SECONDS; } YY_BREAK case 238: YY_RULE_SETUP #line 366 "conf_lexer.l" { return SECONDS; } YY_BREAK case 239: YY_RULE_SETUP #line 368 "conf_lexer.l" { return BYTES; } YY_BREAK case 240: YY_RULE_SETUP #line 369 "conf_lexer.l" { return BYTES; } YY_BREAK case 241: YY_RULE_SETUP #line 370 "conf_lexer.l" { return KBYTES; } YY_BREAK case 242: YY_RULE_SETUP #line 371 "conf_lexer.l" { return KBYTES; } YY_BREAK case 243: YY_RULE_SETUP #line 372 "conf_lexer.l" { return KBYTES; } YY_BREAK case 244: YY_RULE_SETUP #line 373 "conf_lexer.l" { return KBYTES; } YY_BREAK case 245: YY_RULE_SETUP #line 374 "conf_lexer.l" { return KBYTES; } YY_BREAK case 246: YY_RULE_SETUP #line 375 "conf_lexer.l" { return MBYTES; } YY_BREAK case 247: YY_RULE_SETUP #line 376 "conf_lexer.l" { return MBYTES; } YY_BREAK case 248: YY_RULE_SETUP #line 377 "conf_lexer.l" { return MBYTES; } YY_BREAK case 249: YY_RULE_SETUP #line 378 "conf_lexer.l" { return MBYTES; } YY_BREAK case 250: YY_RULE_SETUP #line 379 "conf_lexer.l" { return MBYTES; } YY_BREAK case 251: YY_RULE_SETUP #line 380 "conf_lexer.l" { return TWODOTS; } YY_BREAK case 252: YY_RULE_SETUP #line 382 "conf_lexer.l" { return yytext[0]; } YY_BREAK case YY_STATE_EOF(INITIAL): #line 383 "conf_lexer.l" { if (ieof()) yyterminate(); } YY_BREAK case 253: YY_RULE_SETUP #line 385 "conf_lexer.l" ECHO; YY_BREAK #line 3344 "conf_lexer.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1629 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1629 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 1628); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 385 "conf_lexer.l" /* C-comment ignoring routine -kre*/ static void ccomment(void) { int c = 0; /* log(L_NOTICE, "got comment"); */ while (1) { while ((c = input()) != '*' && c != EOF) if (c == '\n') ++lineno; if (c == '*') { while ((c = input()) == '*') /* Nothing */ ; if (c == '/') break; else if (c == '\n') ++lineno; } if (c == EOF) { YY_FATAL_ERROR("EOF in comment"); /* XXX hack alert this disables * the stupid unused function warning * gcc generates */ if (1 == 0) yy_fatal_error("EOF in comment"); break; } } } /* C-style .includes. This function will properly swap input conf buffers, * and lineno -kre */ static void cinclude(void) { char *p = NULL; if ((p = strchr(yytext, '<')) == NULL) *strchr(p = strchr(yytext, '"') + 1, '"') = '\0'; else *strchr(++p, '>') = '\0'; /* log(L_NOTICE, "got include %s!", c); */ /* do stacking and co. */ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) ilog(LOG_TYPE_IRCD, "Includes nested too deep in %s", p); else { FILE *tmp_fbfile_in = NULL; char filenamebuf[IRCD_BUFSIZE]; if (*p == '/') /* if it is an absolute path */ snprintf(filenamebuf, sizeof(filenamebuf), "%s", p); else snprintf(filenamebuf, sizeof(filenamebuf), "%s/%s", ETCPATH, p); tmp_fbfile_in = fopen(filenamebuf, "r"); if (tmp_fbfile_in == NULL) { ilog(LOG_TYPE_IRCD, "Unable to read configuration file '%s': %s", filenamebuf, strerror(errno)); return; } lineno_stack[include_stack_ptr] = lineno; lineno = 1; inc_fbfile_in[include_stack_ptr] = conf_parser_ctx.conf_file; strlcpy(conffile_stack[include_stack_ptr], conffilebuf, IRCD_BUFSIZE); include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; conf_parser_ctx.conf_file = tmp_fbfile_in; snprintf(conffilebuf, sizeof(conffilebuf), "%s", filenamebuf); yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE)); } } /* This is function that will be called on EOF in conf file. It will * apropriately close conf if it not main conf and swap input buffers -kre * */ static int ieof(void) { /* log(L_NOTICE, "return from include stack!"); */ if (include_stack_ptr) fclose(conf_parser_ctx.conf_file); if (--include_stack_ptr < 0) { /* log(L_NOTICE, "terminating lexer"); */ /* We will now exit the lexer - restore init values if we get /rehash * later and reenter lexer -kre */ include_stack_ptr = 0; lineno = 1; return 1; } /* switch buffer */ /* log(L_NOTICE, "deleting include_stack_ptr=%d", include_stack_ptr); */ yy_delete_buffer(YY_CURRENT_BUFFER); lineno = lineno_stack[include_stack_ptr]; conf_parser_ctx.conf_file = inc_fbfile_in[include_stack_ptr]; strlcpy(conffilebuf, conffile_stack[include_stack_ptr], sizeof(conffilebuf)); yy_switch_to_buffer(include_stack[include_stack_ptr]); return 0; } ircd-hybrid-8.1.13.dfsg.1/src/match.c0000644000175000017500000005132712263053413015243 0ustar domdom/************************************************************************ * IRC - Internet Relay Chat, src/match.c * Copyright (C) 1990 Jarkko Oikarinen * * 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 1, 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. * * $Id: match.c 1884 2013-04-27 11:08:02Z michael $ * */ #include "stdinc.h" #include "irc_string.h" #include "ircd.h" /*! \brief Check a string against a mask. * This test checks using traditional IRC wildcards only: '*' means * match zero or more characters of any type; '?' means match exactly * one character of any type. A backslash escapes the next character * so that a wildcard may be matched exactly. * param mask Wildcard-containing mask. * param name String to check against \a mask. * return Zero if \a mask matches \a name, non-zero if no match. */ int match(const char *mask, const char *name) { const char *m = mask, *n = name; const char *m_tmp = mask, *n_tmp = name; int star = 0; while (1) { switch (*m) { case '\0': if (!*n) return 0; backtrack: if (m_tmp == mask) return 1; m = m_tmp; n = ++n_tmp; if (*n == '\0') return 1; break; case '\\': m++; /* allow escaping to force capitalization */ if (*m++ != *n++) goto backtrack; break; case '*': case '?': for (star = 0; ; m++) { if (*m == '*') star = 1; else if (*m == '?') { if (!*n++) goto backtrack; } else break; } if (star) { if (!*m) return 0; else if (*m == '\\') { m_tmp = ++m; if (!*m) return 1; for (n_tmp = n; *n && *n != *m; n++) ; } else { m_tmp = m; for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ; } } /* and fall through */ default: if (!*n) return *m != '\0'; if (ToLower(*m) != ToLower(*n)) goto backtrack; m++; n++; break; } } return 1; } /* * collapse() * Collapse a pattern string into minimal components. * This particular version is "in place", so that it changes the pattern * which is to be reduced to a "minimal" size. * * (C) Carlo Wood - 6 Oct 1998 * Speedup rewrite by Andrea Cocito, December 1998. * Note that this new optimized algorithm can *only* work in place. */ /*! \brief Collapse a mask string to remove redundancies. * Specifically, it replaces a sequence of '*' followed by additional * '*' or '?' with the same number of '?'s as the input, followed by * one '*'. This minimizes useless backtracking when matching later. * \param mask Mask string to collapse. * \return Pointer to the start of the string. */ char * collapse(char *mask) { int star = 0; char *m = mask; char *b = NULL; if (m) { do { if ((*m == '*') && ((m[1] == '*') || (m[1] == '?'))) { b = m; do { if (*m == '*') star = 1; else { if (star && (*m != '?')) { *b++ = '*'; star = 0; } *b++ = *m; if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?'))) *b++ = *++m; } } while (*m++); break; } else { if ((*m == '\\') && ((m[1] == '*') || (m[1] == '?'))) m++; } } while (*m++); } return mask; } /* * irccmp - case insensitive comparison of two 0 terminated strings. * * returns 0, if s1 equal to s2 * 1, if not */ int irccmp(const char *s1, const char *s2) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; assert(s1 != NULL); assert(s2 != NULL); for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2) if (*str1 == '\0') return 0; return 1; } int ircncmp(const char *s1, const char *s2, size_t n) { const unsigned char *str1 = (const unsigned char *)s1; const unsigned char *str2 = (const unsigned char *)s2; assert(s1 != NULL); assert(s2 != NULL); assert(n > 0); if (n == 0) return 0; for (; ToUpper(*str1) == ToUpper(*str2); ++str1, ++str2) if (--n == 0 || *str1 == '\0') return 0; return 1; } const unsigned char ToLowerTab[] = { 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; const unsigned char ToUpperTab[] = { 0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ' ', '!', '"', '#', '$', '%', '&', 0x27, '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', 0x5f, '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; /* * CharAttrs table * * NOTE: RFC 1459 sez: anything but a ^G, comma, or space is allowed * for channel names */ const unsigned int CharAttrs[] = { /* 0 */ CNTRL_C, /* 1 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 2 */ CNTRL_C|CHAN_C|NONEOS_C, /* 3 */ CNTRL_C|CHAN_C|NONEOS_C, /* 4 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 5 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 6 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 7 BEL */ CNTRL_C|NONEOS_C, /* 8 \b */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 9 \t */ CNTRL_C|SPACE_C|CHAN_C|VCHAN_C|NONEOS_C, /* 10 \n */ CNTRL_C|SPACE_C|CHAN_C|VCHAN_C|NONEOS_C|EOL_C, /* 11 \v */ CNTRL_C|SPACE_C|CHAN_C|VCHAN_C|NONEOS_C, /* 12 \f */ CNTRL_C|SPACE_C|CHAN_C|VCHAN_C|NONEOS_C, /* 13 \r */ CNTRL_C|SPACE_C|CHAN_C|VCHAN_C|NONEOS_C|EOL_C, /* 14 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 15 */ CNTRL_C|CHAN_C|NONEOS_C, /* 16 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 17 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 18 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 19 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 20 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 21 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 22 */ CNTRL_C|CHAN_C|NONEOS_C, /* 23 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 24 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 25 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 26 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 27 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 28 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 29 */ CNTRL_C|CHAN_C|NONEOS_C, /* 30 */ CNTRL_C|CHAN_C|VCHAN_C|NONEOS_C, /* 31 */ CNTRL_C|CHAN_C|NONEOS_C, /* SP */ PRINT_C|SPACE_C, /* ! */ PRINT_C|KWILD_C|CHAN_C|VCHAN_C|NONEOS_C, /* " */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* # */ PRINT_C|CHANPFX_C|CHAN_C|VCHAN_C|NONEOS_C, /* $ */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* % */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* & */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* ' */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* ( */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* ) */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* * */ PRINT_C|KWILD_C|MWILD_C|CHAN_C|VCHAN_C|NONEOS_C|SERV_C, /* + */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* , */ PRINT_C|NONEOS_C, /* - */ PRINT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* . */ PRINT_C|KWILD_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C|SERV_C, /* / */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* 0 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 1 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 2 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 3 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 4 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 5 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 6 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 7 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 8 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* 9 */ PRINT_C|DIGIT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* : */ PRINT_C|KWILD_C|CHAN_C|VCHAN_C|NONEOS_C|HOST_C, /* ; */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* < */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* = */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* > */ PRINT_C|CHAN_C|VCHAN_C|NONEOS_C, /* ? */ PRINT_C|KWILD_C|MWILD_C|CHAN_C|VCHAN_C|NONEOS_C, /* @ */ PRINT_C|KWILD_C|CHAN_C|VCHAN_C|NONEOS_C, /* A */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* B */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* C */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* D */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* E */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* F */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* G */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* H */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* I */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* J */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* K */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* L */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* M */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* N */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* O */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* P */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* Q */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* R */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* S */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* T */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* U */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* V */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* W */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* X */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* Y */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* Z */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* [ */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* \ */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* ] */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* ^ */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* _ */ PRINT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* ` */ PRINT_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* a */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* b */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* c */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* d */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* e */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* f */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* g */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* h */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* i */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* j */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* k */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* l */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* m */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* n */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* o */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* p */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* q */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* r */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* s */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* t */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* u */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* v */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* w */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* x */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* y */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* z */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C|HOST_C, /* { */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* | */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* } */ PRINT_C|ALPHA_C|NICK_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* ~ */ PRINT_C|ALPHA_C|CHAN_C|VCHAN_C|NONEOS_C|USER_C, /* del */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x80 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x81 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x82 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x83 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x84 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x85 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x86 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x87 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x88 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x89 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8A */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8B */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8C */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8D */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8E */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x8F */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x90 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x91 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x92 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x93 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x94 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x95 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x96 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x97 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x98 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x99 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9A */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9B */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9C */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9D */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9E */ CHAN_C|VCHAN_C|NONEOS_C, /* 0x9F */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA0 */ CHAN_C|NONEOS_C, /* 0xA1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xA9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAD */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xAF */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB0 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xB9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBD */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xBF */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC0 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xC9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCD */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xCF */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD0 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xD9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDD */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xDF */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE0 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xE9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xEA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xEB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xEC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xED */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xEE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xEF */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF0 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF1 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF2 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF3 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF4 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF5 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF6 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF7 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF8 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xF9 */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFA */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFB */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFC */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFD */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFE */ CHAN_C|VCHAN_C|NONEOS_C, /* 0xFF */ CHAN_C|VCHAN_C|NONEOS_C }; ircd-hybrid-8.1.13.dfsg.1/src/event.c0000644000175000017500000001616012263053413015264 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * event.c: Event functions. * * Copyright (C) 1998-2000 Regents of the University of California * Copyright (C) 2001-2002 Hybrid Development Team * * Code borrowed from the squid web cache by Adrian Chadd. * Original header: * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ * ---------------------------------------------------------- * * Squid is the result of efforts by numerous individuals from the * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by * the Regents of the University of California. Please see the * COPYRIGHT file for full details. Squid incorporates software * developed and/or copyrighted by other sources. Please see the * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: event.c 2679 2013-12-15 18:37:41Z michael $ */ /* * How it's used: * * Should be pretty self-explanatory. Events are added to the static * array event_table with a frequency time telling eventRun how often * to execute it. */ #include "stdinc.h" #include "list.h" #include "ircd.h" #include "event.h" #include "client.h" #include "send.h" #include "memory.h" #include "log.h" #include "numeric.h" #include "rng_mt.h" static const char *last_event_ran = NULL; static struct ev_entry event_table[MAX_EVENTS]; static time_t event_time_min = -1; static int eventFind(EVH *func, void *arg); /* * void eventAdd(const char *name, EVH *func, void *arg, time_t when) * * Input: Name of event, function to call, arguments to pass, and frequency * of the event. * Output: None * Side Effects: Adds the event to the event list. */ void eventAdd(const char *name, EVH *func, void *arg, time_t when) { int i; /* find first inactive index, or use next index */ for (i = 0; i < MAX_EVENTS; i++) { if (event_table[i].active == 0) { event_table[i].func = func; event_table[i].name = name; event_table[i].arg = arg; event_table[i].when = CurrentTime + when; event_table[i].frequency = when; event_table[i].active = 1; if ((event_table[i].when < event_time_min) || (event_time_min == -1)) event_time_min = event_table[i].when; return; } } /* XXX if reach here, its an error */ ilog(LOG_TYPE_IRCD, "Event table is full! (%d)", i); } /* * void eventDelete(EVH *func, void *arg) * * Input: Function handler, argument that was passed. * Output: None * Side Effects: Removes the event from the event list */ void eventDelete(EVH *func, void *arg) { int i = eventFind(func, arg); if (i == -1) return; event_table[i].name = NULL; event_table[i].func = NULL; event_table[i].arg = NULL; event_table[i].active = 0; } /* * void eventAddIsh(const char *name, EVH *func, void *arg, time_t delta_isa) * * Input: Name of event, function to call, arguments to pass, and frequency * of the event. * Output: None * Side Effects: Adds the event to the event list within +- 1/3 of the * specified frequency. */ void eventAddIsh(const char *name, EVH *func, void *arg, time_t delta_ish) { if (delta_ish >= 3) { const time_t two_third = (2 * delta_ish) / 3; delta_ish = two_third + ((genrand_int32() % 1000) * two_third) / 1000; /* * XXX I hate the above magic, I don't even know if its right. * Grr. -- adrian */ } eventAdd(name, func, arg, delta_ish); } /* * void eventRun(void) * * Input: None * Output: None * Side Effects: Runs pending events in the event list */ void eventRun(void) { int i; for (i = 0; i < MAX_EVENTS; i++) { if (event_table[i].active && (event_table[i].when <= CurrentTime)) { last_event_ran = event_table[i].name; event_table[i].func(event_table[i].arg); event_table[i].when = CurrentTime + event_table[i].frequency; event_time_min = -1; } } } /* * time_t eventNextTime(void) * * Input: None * Output: Specifies the next time eventRun() should be run * Side Effects: None */ time_t eventNextTime(void) { int i; if (event_time_min == -1) { for (i = 0; i < MAX_EVENTS; i++) { if (event_table[i].active && ((event_table[i].when < event_time_min) || (event_time_min == -1))) event_time_min = event_table[i].when; } } return(event_time_min); } /* * void eventInit(void) * * Input: None * Output: None * Side Effects: Initializes the event system. */ void eventInit(void) { last_event_ran = NULL; memset(event_table, 0, sizeof(event_table)); } /* * int eventFind(EVH *func, void *arg) * * Input: Event function and the argument passed to it * Output: Index to the slow in the event_table * Side Effects: None */ static int eventFind(EVH *func, void *arg) { int i; for (i = 0; i < MAX_EVENTS; i++) { if ((event_table[i].func == func) && (event_table[i].arg == arg) && event_table[i].active) return(i); } return(-1); } /* * void show_events(struct Client *source_p) * * Input: Client requesting the event * Output: List of events * Side Effects: None */ void show_events(struct Client *source_p) { int i; if (last_event_ran) { sendto_one(source_p, ":%s %d %s :Last event to run: %s", me.name, RPL_STATSDEBUG, source_p->name, last_event_ran); sendto_one(source_p, ":%s %d %s : ", me.name, RPL_STATSDEBUG, source_p->name); } sendto_one(source_p, ":%s %d %s : Operation Next Execution", me.name, RPL_STATSDEBUG, source_p->name); sendto_one(source_p, ":%s %d %s : -------------------------------------------", me.name, RPL_STATSDEBUG, source_p->name); for (i = 0; i < MAX_EVENTS; i++) { if (event_table[i].active) { sendto_one(source_p, ":%s %d %s : %-28s %-4d seconds", me.name, RPL_STATSDEBUG, source_p->name, event_table[i].name, (int)(event_table[i].when - CurrentTime)); } } } /* * void set_back_events(time_t by) * Input: Time to set back events by. * Output: None. * Side-effects: Sets back all events by "by" seconds. */ void set_back_events(time_t by) { int i; event_time_min = -1; for (i = 0; i < MAX_EVENTS; i++) { if (event_table[i].when > by) event_table[i].when -= by; else event_table[i].when = 0; } } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd_devpoll.c0000644000175000017500000001103612263053413016757 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd_devpoll.c: /dev/poll compatible network routines. * * Originally by Adrian Chadd * Copyright (C) 2002 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd_devpoll.c 2724 2013-12-29 13:00:42Z michael $ */ #include "stdinc.h" #if USE_IOPOLL_MECHANISM == __IOPOLL_MECHANISM_DEVPOLL #include /* HPUX uses devpoll.h and not sys/devpoll.h */ #ifdef HAVE_DEVPOLL_H # include #else # ifdef HAVE_SYS_DEVPOLL_H # include # else # error "No devpoll.h found! Try ./configuring and letting the script choose for you." # endif #endif #include "fdlist.h" #include "ircd.h" #include "s_bsd.h" #include "log.h" static fde_t dpfd; /* * init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ void init_netio(void) { int fd; if ((fd = open("/dev/poll", O_RDWR)) < 0) { ilog(LOG_TYPE_IRCD, "init_netio: Couldn't open /dev/poll - %d: %s", errno, strerror(errno)); exit(115); /* Whee! */ } fd_open(&dpfd, fd, 0, "/dev/poll file descriptor"); } /* * Write an update to the devpoll filter. * See, we end up having to do a seperate (?) remove before we do an * add of a new polltype, so we have to have this function seperate from * the others. */ static void devpoll_write_update(int fd, int events) { struct pollfd pfd; /* Build the pollfd entry */ pfd.revents = 0; pfd.fd = fd; pfd.events = events; /* Write the thing to our poll fd */ if (write(dpfd.fd, &pfd, sizeof(pfd)) != sizeof(pfd)) ilog(LOG_TYPE_IRCD, "devpoll_write_update: dpfd write failed %d: %s", errno, strerror(errno)); } /* * comm_setselect * * This is a needed exported function which will be called to register * and deregister interest in a pending IO state for a given FD. */ void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) { int new_events; if ((type & COMM_SELECT_READ)) { F->read_handler = handler; F->read_data = client_data; } if ((type & COMM_SELECT_WRITE)) { F->write_handler = handler; F->write_data = client_data; } new_events = (F->read_handler ? POLLIN : 0) | (F->write_handler ? POLLOUT : 0); if (timeout != 0) { F->timeout = CurrentTime + (timeout / 1000); F->timeout_handler = handler; F->timeout_data = client_data; } if (new_events != F->evcache) { devpoll_write_update(F->fd, POLLREMOVE); if ((F->evcache = new_events)) devpoll_write_update(F->fd, new_events); } } /* * comm_select * * Called to do the new-style IO, courtesy of squid (like most of this * new IO code). This routine handles the stuff we've hidden in * comm_setselect and fd_table[] and calls callbacks for IO ready * events. */ void comm_select(void) { int num, i; struct pollfd pollfds[128]; struct dvpoll dopoll; PF *hdl; fde_t *F; dopoll.dp_timeout = SELECT_DELAY; dopoll.dp_nfds = 128; dopoll.dp_fds = &pollfds[0]; num = ioctl(dpfd.fd, DP_POLL, &dopoll); set_time(); if (num < 0) { #ifdef HAVE_USLEEP usleep(50000); /* avoid 99% CPU in comm_select */ #endif return; } for (i = 0; i < num; i++) { F = lookup_fd(dopoll.dp_fds[i].fd); if (F == NULL || !F->flags.open) continue; if ((dopoll.dp_fds[i].revents & POLLIN)) { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); if (!F->flags.open) continue; } } if ((dopoll.dp_fds[i].revents & POLLOUT)) { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); if (!F->flags.open) continue; } } comm_setselect(F, 0, NULL, NULL, 0); } } #endif ircd-hybrid-8.1.13.dfsg.1/src/client.c0000644000175000017500000010663412263053413015427 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * client.c: Controls clients. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: client.c 2740 2014-01-04 20:04:39Z michael $ */ #include "stdinc.h" #include "list.h" #include "client.h" #include "channel_mode.h" #include "event.h" #include "fdlist.h" #include "hash.h" #include "irc_string.h" #include "ircd.h" #include "s_gline.h" #include "numeric.h" #include "packet.h" #include "s_auth.h" #include "s_bsd.h" #include "conf.h" #include "log.h" #include "s_misc.h" #include "s_serv.h" #include "send.h" #include "whowas.h" #include "s_user.h" #include "dbuf.h" #include "memory.h" #include "mempool.h" #include "hostmask.h" #include "listener.h" #include "irc_res.h" #include "userhost.h" #include "watch.h" #include "rng_mt.h" #include "parse.h" dlink_list listing_client_list = { NULL, NULL, 0 }; /* Pointer to beginning of Client list */ dlink_list global_client_list = {NULL, NULL, 0}; /* unknown/client pointer lists */ dlink_list unknown_list = {NULL, NULL, 0}; dlink_list local_client_list = {NULL, NULL, 0}; dlink_list serv_list = {NULL, NULL, 0}; dlink_list global_serv_list = {NULL, NULL, 0}; dlink_list oper_list = {NULL, NULL, 0}; static EVH check_pings; static mp_pool_t *client_pool = NULL; static mp_pool_t *lclient_pool = NULL; static dlink_list dead_list = { NULL, NULL, 0}; static dlink_list abort_list = { NULL, NULL, 0}; static dlink_node *eac_next; /* next aborted client to exit */ static void check_pings_list(dlink_list *); static void check_unknowns_list(void); static void ban_them(struct Client *, struct MaskItem *); /* client_init() * * inputs - NONE * output - NONE * side effects - initialize client free memory */ void client_init(void) { /* start off the check ping event .. -- adrian * Every 30 seconds is plenty -- db */ client_pool = mp_pool_new(sizeof(struct Client), MP_CHUNK_SIZE_CLIENT); lclient_pool = mp_pool_new(sizeof(struct LocalUser), MP_CHUNK_SIZE_LCLIENT); eventAdd("check_pings", check_pings, NULL, 5); } /* * make_client - create a new Client struct and set it to initial state. * * from == NULL, create local client (a client connected * to a socket). * WARNING: This leaves the client in a dangerous * state where fd == -1, dead flag is not set and * the client is on the unknown_list; therefore, * the first thing to do after calling make_client(NULL) * is setting fd to something reasonable. -adx * * from, create remote client (behind a socket * associated with the client defined by * 'from'). ('from' is a local client!!). */ struct Client * make_client(struct Client *from) { struct Client *client_p = mp_pool_get(client_pool); memset(client_p, 0, sizeof(*client_p)); if (from == NULL) { client_p->from = client_p; /* 'from' of local client is self! */ client_p->localClient = mp_pool_get(lclient_pool); memset(client_p->localClient, 0, sizeof(*client_p->localClient)); client_p->localClient->since = CurrentTime; client_p->localClient->lasttime = CurrentTime; client_p->localClient->firsttime = CurrentTime; client_p->localClient->registration = REG_INIT; /* as good a place as any... */ dlinkAdd(client_p, &client_p->localClient->lclient_node, &unknown_list); } else client_p->from = from; /* 'from' of local client is self! */ client_p->idhnext = client_p; client_p->hnext = client_p; SetUnknown(client_p); strcpy(client_p->username, "unknown"); strcpy(client_p->svid, "0"); return client_p; } /* * free_client * * inputs - pointer to client * output - NONE * side effects - client pointed to has its memory freed */ static void free_client(struct Client *client_p) { assert(client_p != NULL); assert(client_p != &me); assert(client_p->hnext == client_p); assert(client_p->idhnext == client_p); assert(client_p->channel.head == NULL); assert(dlink_list_length(&client_p->channel) == 0); assert(dlink_list_length(&client_p->whowas) == 0); assert(!IsServer(client_p) || (IsServer(client_p) && client_p->serv)); MyFree(client_p->serv); MyFree(client_p->certfp); if (MyConnect(client_p)) { assert(client_p->localClient->invited.head == NULL); assert(dlink_list_length(&client_p->localClient->invited) == 0); assert(dlink_list_length(&client_p->localClient->watches) == 0); assert(IsClosing(client_p) && IsDead(client_p)); MyFree(client_p->localClient->response); MyFree(client_p->localClient->auth_oper); /* * clean up extra sockets from P-lines which have been discarded. */ if (client_p->localClient->listener) { assert(0 < client_p->localClient->listener->ref_count); if (0 == --client_p->localClient->listener->ref_count && !client_p->localClient->listener->active) free_listener(client_p->localClient->listener); } dbuf_clear(&client_p->localClient->buf_recvq); dbuf_clear(&client_p->localClient->buf_sendq); mp_pool_release(client_p->localClient); } mp_pool_release(client_p); } /* * check_pings - go through the local client list and check activity * kill off stuff that should die * * inputs - NOT USED (from event) * output - next time_t when check_pings() should be called again * side effects - * * * A PING can be sent to clients as necessary. * * Client/Server ping outs are handled. */ /* * Addon from adrian. We used to call this after nextping seconds, * however I've changed it to run once a second. This is only for * PING timeouts, not K/etc-line checks (thanks dianora!). Having it * run once a second makes life a lot easier - when a new client connects * and they need a ping in 4 seconds, if nextping was set to 20 seconds * we end up waiting 20 seconds. This is stupid. :-) * I will optimise (hah!) check_pings() once I've finished working on * tidying up other network IO evilnesses. * -- adrian */ static void check_pings(void *notused) { check_pings_list(&local_client_list); check_pings_list(&serv_list); check_unknowns_list(); } /* check_pings_list() * * inputs - pointer to list to check * output - NONE * side effects - */ static void check_pings_list(dlink_list *list) { char scratch[IRCD_BUFSIZE]; int ping = 0; /* ping time value from client */ dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, list->head) { struct Client *client_p = ptr->data; /* ** Note: No need to notify opers here. It's ** already done when "FLAGS_DEADSOCKET" is set. */ if (IsDead(client_p)) { /* Ignore it, its been exited already */ continue; } if (!IsRegistered(client_p)) ping = CONNECTTIMEOUT; else ping = get_client_ping(&client_p->localClient->confs); if (ping < CurrentTime - client_p->localClient->lasttime) { if (!IsPingSent(client_p)) { /* * if we havent PINGed the connection and we havent * heard from it in a while, PING it to make sure * it is still alive. */ SetPingSent(client_p); client_p->localClient->lasttime = CurrentTime - ping; sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p)); } else { if (CurrentTime - client_p->localClient->lasttime >= 2 * ping) { /* * If the client/server hasn't talked to us in 2*ping seconds * and it has a ping time, then close its connection. */ if (IsServer(client_p) || IsHandshake(client_p)) { sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "No response from %s, closing link", get_client_name(client_p, HIDE_IP)); sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "No response from %s, closing link", get_client_name(client_p, MASK_IP)); ilog(LOG_TYPE_IRCD, "No response from %s, closing link", get_client_name(client_p, HIDE_IP)); } snprintf(scratch, sizeof(scratch), "Ping timeout: %d seconds", (int)(CurrentTime - client_p->localClient->lasttime)); exit_client(client_p, &me, scratch); } } } } } /* check_unknowns_list() * * inputs - pointer to list of unknown clients * output - NONE * side effects - unknown clients get marked for termination after n seconds */ static void check_unknowns_list(void) { dlink_node *ptr, *next_ptr; DLINK_FOREACH_SAFE(ptr, next_ptr, unknown_list.head) { struct Client *client_p = ptr->data; /* * Check UNKNOWN connections - if they have been in this state * for > 30s, close them. */ if (IsAuthFinished(client_p) && (CurrentTime - client_p->localClient->firsttime) > 30) exit_client(client_p, &me, "Registration timed out"); } } /* check_conf_klines() * * inputs - NONE * output - NONE * side effects - Check all connections for a pending kline against the * client, exit the client if a kline matches. */ void check_conf_klines(void) { struct Client *client_p = NULL; /* current local client_p being examined */ struct MaskItem *conf = NULL; dlink_node *ptr, *next_ptr; DLINK_FOREACH_SAFE(ptr, next_ptr, local_client_list.head) { client_p = ptr->data; /* If a client is already being exited */ if (IsDead(client_p) || !IsClient(client_p)) continue; if ((conf = find_dline_conf(&client_p->localClient->ip, client_p->localClient->aftype)) != NULL) { if (conf->type == CONF_EXEMPT) continue; ban_them(client_p, conf); continue; /* and go examine next fd/client_p */ } if (ConfigFileEntry.glines) { if ((conf = find_conf_by_address(client_p->host, &client_p->localClient->ip, CONF_GLINE, client_p->localClient->aftype, client_p->username, NULL, 1))) { if (IsExemptKline(client_p) || IsExemptGline(client_p)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "GLINE over-ruled for %s, client is %sline_exempt", get_client_name(client_p, HIDE_IP), IsExemptKline(client_p) ? "k" : "g"); continue; } ban_them(client_p, conf); /* and go examine next fd/client_p */ continue; } } if ((conf = find_conf_by_address(client_p->host, &client_p->localClient->ip, CONF_KLINE, client_p->localClient->aftype, client_p->username, NULL, 1))) { if (IsExemptKline(client_p)) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "KLINE over-ruled for %s, client is kline_exempt", get_client_name(client_p, HIDE_IP)); continue; } ban_them(client_p, conf); continue; } if ((conf = find_matching_name_conf(CONF_XLINE, client_p->info, NULL, NULL, 0))) { ban_them(client_p, conf); continue; } } /* also check the unknowns list for new dlines */ DLINK_FOREACH_SAFE(ptr, next_ptr, unknown_list.head) { client_p = ptr->data; if ((conf = find_dline_conf(&client_p->localClient->ip, client_p->localClient->aftype))) { if (conf->type == CONF_EXEMPT) continue; exit_client(client_p, &me, "D-lined"); } } } /* * ban_them * * inputs - pointer to client to ban * - pointer to MaskItem * output - NONE * side effects - given client_p is banned */ static void ban_them(struct Client *client_p, struct MaskItem *conf) { const char *user_reason = NULL; /* What is sent to user */ const char *type_string = NULL; const char dline_string[] = "D-line"; const char kline_string[] = "K-line"; const char gline_string[] = "G-line"; const char xline_string[] = "X-line"; switch (conf->type) { case CONF_KLINE: type_string = kline_string; break; case CONF_DLINE: type_string = dline_string; break; case CONF_GLINE: type_string = gline_string; break; case CONF_XLINE: type_string = xline_string; ++conf->count; break; default: assert(0); break; } user_reason = conf->reason ? conf->reason : type_string; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s active for %s", type_string, get_client_name(client_p, HIDE_IP)); if (IsClient(client_p)) sendto_one(client_p, form_str(ERR_YOUREBANNEDCREEP), me.name, client_p->name, user_reason); exit_client(client_p, &me, user_reason); } /* update_client_exit_stats() * * input - pointer to client * output - NONE * side effects - */ static void update_client_exit_stats(struct Client *client_p) { if (IsClient(client_p)) { assert(Count.total > 0); --Count.total; if (HasUMode(client_p, UMODE_OPER)) --Count.oper; if (HasUMode(client_p, UMODE_INVISIBLE)) --Count.invisi; } else if (IsServer(client_p)) sendto_realops_flags(UMODE_EXTERNAL, L_ALL, SEND_NOTICE, "Server %s split from %s", client_p->name, client_p->servptr->name); if (splitchecking && !splitmode) check_splitmode(NULL); } /* find_person() * * inputs - pointer to name * output - return client pointer * side effects - find person by (nick)name */ struct Client * find_person(const struct Client *client_p, const char *name) { struct Client *target_p = NULL; if (IsDigit(*name)) { if (IsServer(client_p) || HasFlag(client_p, FLAGS_SERVICE)) target_p = hash_find_id(name); } else target_p = hash_find_client(name); return (target_p && IsClient(target_p)) ? target_p : NULL; } /* * find_chasing - find the client structure for a nick name (name) * using history mechanism if necessary. If the client is not found, * an error message (NO SUCH NICK) is generated. If the client was found * through the history, chasing will be 1 and otherwise 0. */ struct Client * find_chasing(struct Client *source_p, const char *name, int *const chasing) { struct Client *who = find_person(source_p->from, name); if (chasing) *chasing = 0; if (who) return who; if (IsDigit(*name)) return NULL; if ((who = whowas_get_history(name, (time_t)ConfigFileEntry.kill_chase_time_limit)) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, name); return NULL; } if (chasing) *chasing = 1; return who; } /* * get_client_name - Return the name of the client * for various tracking and * admin purposes. The main purpose of this function is to * return the "socket host" name of the client, if that * differs from the advertised name (other than case). * But, this can be used to any client structure. * * NOTE 1: * Watch out the allocation of "nbuf", if either source_p->name * or source_p->sockhost gets changed into pointers instead of * directly allocated within the structure... * * NOTE 2: * Function return either a pointer to the structure (source_p) or * to internal buffer (nbuf). *NEVER* use the returned pointer * to modify what it points!!! */ const char * get_client_name(const struct Client *client, enum addr_mask_type type) { static char nbuf[HOSTLEN * 2 + USERLEN + 5]; assert(client != NULL); if (!MyConnect(client)) return client->name; if (IsServer(client) || IsConnecting(client) || IsHandshake(client)) { if (!irccmp(client->name, client->host)) return client->name; else if (ConfigServerHide.hide_server_ips) type = MASK_IP; } if (ConfigFileEntry.hide_spoof_ips) if (type == SHOW_IP && IsIPSpoof(client)) type = MASK_IP; /* And finally, let's get the host information, ip or name */ switch (type) { case SHOW_IP: snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", client->name, client->username, client->sockhost); break; case MASK_IP: if (client->localClient->aftype == AF_INET) snprintf(nbuf, sizeof(nbuf), "%s[%s@255.255.255.255]", client->name, client->username); else snprintf(nbuf, sizeof(nbuf), "%s[%s@ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]", client->name, client->username); break; default: snprintf(nbuf, sizeof(nbuf), "%s[%s@%s]", client->name, client->username, client->host); } return nbuf; } void free_exited_clients(void) { dlink_node *ptr = NULL, *next = NULL; DLINK_FOREACH_SAFE(ptr, next, dead_list.head) { free_client(ptr->data); dlinkDelete(ptr, &dead_list); free_dlink_node(ptr); } } /* * Exit one client, local or remote. Assuming all dependents have * been already removed, and socket closed for local client. * * The only messages generated are QUITs on channels. */ static void exit_one_client(struct Client *source_p, const char *quitmsg) { dlink_node *lp = NULL, *next_lp = NULL; assert(!IsMe(source_p)); if (IsClient(source_p)) { if (source_p->servptr->serv != NULL) dlinkDelete(&source_p->lnode, &source_p->servptr->serv->client_list); /* * If a person is on a channel, send a QUIT notice * to every client (person) on the same channel (so * that the client can show the "**signoff" message). * (Note: The notice is to the local clients *only*) */ sendto_common_channels_local(source_p, 0, 0, ":%s!%s@%s QUIT :%s", source_p->name, source_p->username, source_p->host, quitmsg); DLINK_FOREACH_SAFE(lp, next_lp, source_p->channel.head) remove_user_from_channel(lp->data); whowas_add_history(source_p, 0); whowas_off_history(source_p); watch_check_hash(source_p, RPL_LOGOFF); if (MyConnect(source_p)) { /* Clean up invitefield */ DLINK_FOREACH_SAFE(lp, next_lp, source_p->localClient->invited.head) del_invite(lp->data, source_p); del_all_accepts(source_p); } } else if (IsServer(source_p)) { dlinkDelete(&source_p->lnode, &source_p->servptr->serv->server_list); if ((lp = dlinkFindDelete(&global_serv_list, source_p)) != NULL) free_dlink_node(lp); } /* Remove source_p from the client lists */ if (HasID(source_p)) hash_del_id(source_p); if (source_p->name[0]) hash_del_client(source_p); if (IsUserHostIp(source_p)) delete_user_host(source_p->username, source_p->host, !MyConnect(source_p)); /* remove from global client list * NOTE: source_p->node.next cannot be NULL if the client is added * to global_client_list (there is always &me at its end) */ if (source_p != NULL && source_p->node.next != NULL) dlinkDelete(&source_p->node, &global_client_list); update_client_exit_stats(source_p); /* Check to see if the client isn't already on the dead list */ assert(dlinkFind(&dead_list, source_p) == NULL); /* add to dead client dlist */ SetDead(source_p); dlinkAdd(source_p, make_dlink_node(), &dead_list); } /* Recursively send QUITs and SQUITs for source_p and all its dependent clients * and servers to those servers that need them. A server needs the client * QUITs if it can't figure them out from the SQUIT (ie pre-TS4) or if it * isn't getting the SQUIT because of @#(*&@)# hostmasking. With TS4, once * a link gets a SQUIT, it doesn't need any QUIT/SQUITs for clients depending * on that one -orabidoo * * This is now called on each local server -adx */ static void recurse_send_quits(struct Client *original_source_p, struct Client *source_p, struct Client *from, struct Client *to, const char *comment, const char *splitstr) { dlink_node *ptr, *next; struct Client *target_p; assert(to != source_p); /* should be already removed from serv_list */ /* If this server can handle quit storm (QS) removal * of dependents, just send the SQUIT */ if (!IsCapable(to, CAP_QS)) DLINK_FOREACH_SAFE(ptr, next, source_p->serv->client_list.head) { target_p = ptr->data; sendto_one(to, ":%s QUIT :%s", target_p->name, splitstr); } DLINK_FOREACH_SAFE(ptr, next, source_p->serv->server_list.head) recurse_send_quits(original_source_p, ptr->data, from, to, comment, splitstr); if ((source_p == original_source_p && to != from) || !IsCapable(to, CAP_QS)) { /* don't use a prefix here - we have to be 100% sure the message * will be accepted without Unknown prefix etc.. */ sendto_one(to, "SQUIT %s :%s", ID_or_name(source_p, to), comment); } } /* * Remove all clients that depend on source_p; assumes all (S)QUITs have * already been sent. we make sure to exit a server's dependent clients * and servers before the server itself; exit_one_client takes care of * actually removing things off llists. tweaked from +CSr31 -orabidoo */ static void recurse_remove_clients(struct Client *source_p, const char *quitmsg) { dlink_node *ptr, *next; DLINK_FOREACH_SAFE(ptr, next, source_p->serv->client_list.head) exit_one_client(ptr->data, quitmsg); DLINK_FOREACH_SAFE(ptr, next, source_p->serv->server_list.head) { recurse_remove_clients(ptr->data, quitmsg); exit_one_client(ptr->data, quitmsg); } } /* ** Remove *everything* that depends on source_p, from all lists, and sending ** all necessary QUITs and SQUITs. source_p itself is still on the lists, ** and its SQUITs have been sent except for the upstream one -orabidoo */ static void remove_dependents(struct Client *source_p, struct Client *from, const char *comment, const char *splitstr) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, serv_list.head) recurse_send_quits(source_p, source_p, from, ptr->data, comment, splitstr); recurse_remove_clients(source_p, splitstr); } /* * exit_client - exit a client of any type. Generally, you can use * this on any struct Client, regardless of its state. * * Note, you shouldn't exit remote _users_ without first doing * AddFlag(x, FLAGS_KILLED) and propagating a kill or similar message. * However, it is perfectly correct to call exit_client to force a _server_ * quit (either local or remote one). * * inputs: - a client pointer that is going to be exited * - for servers, the second argument is a pointer to who * is firing the server. This side won't get any generated * messages. NEVER NULL! * output: none * side effects: the client is delinked from all lists, disconnected, * and the rest of IRC network is notified of the exit. * Client memory is scheduled to be freed */ void exit_client(struct Client *source_p, struct Client *from, const char *comment) { dlink_node *m = NULL; if (MyConnect(source_p)) { /* DO NOT REMOVE. exit_client can be called twice after a failed * read/write. */ if (IsClosing(source_p)) return; SetClosing(source_p); if (IsIpHash(source_p)) remove_one_ip(&source_p->localClient->ip); delete_auth(&source_p->localClient->auth); /* * This source_p could have status of one of STAT_UNKNOWN, STAT_CONNECTING * STAT_HANDSHAKE or STAT_UNKNOWN * all of which are lumped together into unknown_list * * In all above cases IsRegistered() will not be true. */ if (!IsRegistered(source_p)) { assert(dlinkFind(&unknown_list, source_p)); dlinkDelete(&source_p->localClient->lclient_node, &unknown_list); } else if (IsClient(source_p)) { time_t on_for = CurrentTime - source_p->localClient->firsttime; assert(Count.local > 0); Count.local--; if (HasUMode(source_p, UMODE_OPER)) if ((m = dlinkFindDelete(&oper_list, source_p)) != NULL) free_dlink_node(m); assert(dlinkFind(&local_client_list, source_p)); dlinkDelete(&source_p->localClient->lclient_node, &local_client_list); if (source_p->localClient->list_task != NULL) free_list_task(source_p->localClient->list_task, source_p); watch_del_watch_list(source_p); sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE, "Client exiting: %s (%s@%s) [%s] [%s]", source_p->name, source_p->username, source_p->host, comment, ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost); ilog(LOG_TYPE_USER, "%s (%3u:%02u:%02u): %s!%s@%s %llu/%llu", myctime(source_p->localClient->firsttime), (unsigned int)(on_for / 3600), (unsigned int)((on_for % 3600)/60), (unsigned int)(on_for % 60), source_p->name, source_p->username, source_p->host, source_p->localClient->send.bytes>>10, source_p->localClient->recv.bytes>>10); } else if (IsServer(source_p)) { assert(Count.myserver > 0); --Count.myserver; assert(dlinkFind(&serv_list, source_p)); dlinkDelete(&source_p->localClient->lclient_node, &serv_list); unset_chcap_usage_counts(source_p); } if (!IsDead(source_p)) { if (IsServer(source_p)) { /* for them, we are exiting the network */ sendto_one(source_p, ":%s SQUIT %s :%s", ID_or_name(from, source_p), me.name, comment); } sendto_one(source_p, "ERROR :Closing Link: %s (%s)", source_p->host, comment); } /* ** Currently only server connections can have ** depending remote clients here, but it does no ** harm to check for all local clients. In ** future some other clients than servers might ** have remotes too... ** ** Close the Client connection first and mark it ** so that no messages are attempted to send to it. ** Remember it makes source_p->from == NULL. */ close_connection(source_p); } else if (IsClient(source_p) && HasFlag(source_p->servptr, FLAGS_EOB)) sendto_realops_flags(UMODE_FARCONNECT, L_ALL, SEND_NOTICE, "Client exiting at %s: %s (%s@%s) [%s]", source_p->servptr->name, source_p->name, source_p->username, source_p->host, comment); if (IsServer(source_p)) { char splitstr[HOSTLEN + HOSTLEN + 2]; /* This shouldn't ever happen */ assert(source_p->serv != NULL && source_p->servptr != NULL); if (ConfigServerHide.hide_servers) /* * Set netsplit message to "*.net *.split" to still show * that its a split, but hide the servers splitting */ strcpy(splitstr, "*.net *.split"); else snprintf(splitstr, sizeof(splitstr), "%s %s", source_p->servptr->name, source_p->name); remove_dependents(source_p, from->from, comment, splitstr); if (source_p->servptr == &me) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s was connected for %d seconds. %llu/%llu sendK/recvK.", source_p->name, (int)(CurrentTime - source_p->localClient->firsttime), source_p->localClient->send.bytes >> 10, source_p->localClient->recv.bytes >> 10); ilog(LOG_TYPE_IRCD, "%s was connected for %d seconds. %llu/%llu sendK/recvK.", source_p->name, (int)(CurrentTime - source_p->localClient->firsttime), source_p->localClient->send.bytes >> 10, source_p->localClient->recv.bytes >> 10); } } else if (IsClient(source_p) && !HasFlag(source_p, FLAGS_KILLED)) { sendto_server(from->from, CAP_TS6, NOCAPS, ":%s QUIT :%s", ID(source_p), comment); sendto_server(from->from, NOCAPS, CAP_TS6, ":%s QUIT :%s", source_p->name, comment); } /* The client *better* be off all of the lists */ assert(dlinkFind(&unknown_list, source_p) == NULL); assert(dlinkFind(&local_client_list, source_p) == NULL); assert(dlinkFind(&serv_list, source_p) == NULL); assert(dlinkFind(&oper_list, source_p) == NULL); exit_one_client(source_p, comment); } /* * dead_link_on_write - report a write error if not already dead, * mark it as dead then exit it */ void dead_link_on_write(struct Client *client_p, int ierrno) { dlink_node *ptr; if (IsDefunct(client_p)) return; dbuf_clear(&client_p->localClient->buf_recvq); dbuf_clear(&client_p->localClient->buf_sendq); assert(dlinkFind(&abort_list, client_p) == NULL); ptr = make_dlink_node(); /* don't let exit_aborted_clients() finish yet */ dlinkAddTail(client_p, ptr, &abort_list); if (eac_next == NULL) eac_next = ptr; SetDead(client_p); /* You are dead my friend */ } /* * dead_link_on_read - report a read error if not already dead, * mark it as dead then exit it */ void dead_link_on_read(struct Client *client_p, int error) { char errmsg[IRCD_BUFSIZE]; int current_error; if (IsDefunct(client_p)) return; dbuf_clear(&client_p->localClient->buf_recvq); dbuf_clear(&client_p->localClient->buf_sendq); current_error = get_sockerr(client_p->localClient->fd.fd); if (IsServer(client_p) || IsHandshake(client_p)) { int connected = CurrentTime - client_p->localClient->firsttime; if (error == 0) { /* Admins get the real IP */ sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, "Server %s closed the connection", get_client_name(client_p, SHOW_IP)); /* Opers get a masked IP */ sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, "Server %s closed the connection", get_client_name(client_p, MASK_IP)); ilog(LOG_TYPE_IRCD, "Server %s closed the connection", get_client_name(client_p, SHOW_IP)); } else { report_error(L_ADMIN, "Lost connection to %s: %s", get_client_name(client_p, SHOW_IP), current_error); report_error(L_OPER, "Lost connection to %s: %s", get_client_name(client_p, MASK_IP), current_error); } sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s had been connected for %d day%s, %2d:%02d:%02d", client_p->name, connected/86400, (connected/86400 == 1) ? "" : "s", (connected % 86400) / 3600, (connected % 3600) / 60, connected % 60); } if (error == 0) strlcpy(errmsg, "Remote host closed the connection", sizeof(errmsg)); else snprintf(errmsg, sizeof(errmsg), "Read error: %s", strerror(current_error)); exit_client(client_p, &me, errmsg); } void exit_aborted_clients(void) { dlink_node *ptr; struct Client *target_p; const char *notice; DLINK_FOREACH_SAFE(ptr, eac_next, abort_list.head) { target_p = ptr->data; eac_next = ptr->next; if (target_p == NULL) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Warning: null client on abort_list!"); dlinkDelete(ptr, &abort_list); free_dlink_node(ptr); continue; } dlinkDelete(ptr, &abort_list); if (IsSendQExceeded(target_p)) notice = "Max SendQ exceeded"; else notice = "Write error: connection closed"; exit_client(target_p, &me, notice); free_dlink_node(ptr); } } /* * accept processing, this adds a form of "caller ID" to ircd * * If a client puts themselves into "caller ID only" mode, * only clients that match a client pointer they have put on * the accept list will be allowed to message them. * * Diane Bruce, "Dianora" db@db.net */ void del_accept(struct split_nuh_item *accept_p, struct Client *client_p) { dlinkDelete(&accept_p->node, &client_p->localClient->acceptlist); MyFree(accept_p->nickptr); MyFree(accept_p->userptr); MyFree(accept_p->hostptr); MyFree(accept_p); } struct split_nuh_item * find_accept(const char *nick, const char *user, const char *host, struct Client *client_p, int (*cmpfunc)(const char *, const char *)) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, client_p->localClient->acceptlist.head) { struct split_nuh_item *accept_p = ptr->data; if (!cmpfunc(accept_p->nickptr, nick) && !cmpfunc(accept_p->userptr, user) && !cmpfunc(accept_p->hostptr, host)) return accept_p; } return NULL; } /* accept_message() * * inputs - pointer to source client * - pointer to target client * output - 1 if accept this message 0 if not * side effects - See if source is on target's allow list */ int accept_message(struct Client *source, struct Client *target) { dlink_node *ptr = NULL; if (source == target || find_accept(source->name, source->username, source->host, target, match)) return 1; if (HasUMode(target, UMODE_SOFTCALLERID)) DLINK_FOREACH(ptr, target->channel.head) if (IsMember(source, ((struct Membership *)ptr->data)->chptr)) return 1; return 0; } /* del_all_accepts() * * inputs - pointer to exiting client * output - NONE * side effects - Walk through given clients acceptlist and remove all entries */ void del_all_accepts(struct Client *client_p) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->acceptlist.head) del_accept(ptr->data, client_p); } unsigned int idle_time_get(const struct Client *source_p, const struct Client *target_p) { unsigned int idle = 0; unsigned int min_idle = 0; unsigned int max_idle = 0; const struct ClassItem *class = get_class_ptr(&target_p->localClient->confs); if (!(class->flags & CLASS_FLAGS_FAKE_IDLE) || target_p == source_p) return CurrentTime - target_p->localClient->last_privmsg; if (HasUMode(source_p, UMODE_OPER) && !(class->flags & CLASS_FLAGS_HIDE_IDLE_FROM_OPERS)) return CurrentTime - target_p->localClient->last_privmsg; min_idle = class->min_idle; max_idle = class->max_idle; if (min_idle == max_idle) return min_idle; if (class->flags & CLASS_FLAGS_RANDOM_IDLE) idle = genrand_int32(); else idle = CurrentTime - target_p->localClient->last_privmsg; if (max_idle == 0) idle = 0; else idle %= max_idle; if (idle < min_idle) idle = min_idle + (idle % (max_idle - min_idle)); return idle; } ircd-hybrid-8.1.13.dfsg.1/src/modules.c0000644000175000017500000002164412263053413015616 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * modules.c: A module loader. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: modules.c 2526 2013-11-02 17:07:55Z michael $ */ #include "ltdl.h" #include "stdinc.h" #include "list.h" #include "modules.h" #include "log.h" #include "ircd.h" #include "client.h" #include "send.h" #include "conf.h" #include "numeric.h" #include "parse.h" #include "ircd_defs.h" #include "irc_string.h" #include "memory.h" dlink_list modules_list = { NULL, NULL, 0 }; static dlink_list mod_paths = { NULL, NULL, 0 }; static dlink_list conf_modules = { NULL, NULL, 0 }; static const char *unknown_ver = ""; static const char *core_module_table[] = { "m_die.la", "m_error.la", "m_join.la", "m_kick.la", "m_kill.la", "m_message.la", "m_mode.la", "m_nick.la", "m_part.la", "m_quit.la", "m_server.la", "m_sjoin.la", "m_squit.la", NULL }; int modules_valid_suffix(const char *name) { return ((name = strrchr(name, '.'))) && !strcmp(name, ".la"); } /* unload_one_module() * * inputs - name of module to unload * - 1 to say modules unloaded, 0 to not * output - 0 if successful, -1 if error * side effects - module is unloaded */ int unload_one_module(const char *name, int warn) { struct module *modp = NULL; if ((modp = findmodule_byname(name)) == NULL) return -1; if (modp->modexit) modp->modexit(); assert(dlink_list_length(&modules_list) > 0); dlinkDelete(&modp->node, &modules_list); MyFree(modp->name); lt_dlclose(modp->handle); if (warn == 1) { ilog(LOG_TYPE_IRCD, "Module %s unloaded", name); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Module %s unloaded", name); } return 0; } /* load_a_module() * * inputs - path name of module, int to notice, int of core * output - -1 if error 0 if success * side effects - loads a module if successful */ int load_a_module(const char *path, int warn) { lt_dlhandle tmpptr = NULL; const char *mod_basename = NULL; struct module *modp = NULL; if (findmodule_byname((mod_basename = libio_basename(path)))) return 1; if (!(tmpptr = lt_dlopen(path))) { const char *err = ((err = lt_dlerror())) ? err : ""; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Error loading module %s: %s", mod_basename, err); ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); return -1; } if ((modp = lt_dlsym(tmpptr, "module_entry")) == NULL) { const char *err = ((err = lt_dlerror())) ? err : ""; sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Error loading module %s: %s", mod_basename, err); ilog(LOG_TYPE_IRCD, "Error loading module %s: %s", mod_basename, err); lt_dlclose(tmpptr); return -1; } modp->handle = tmpptr; if (EmptyString(modp->version)) modp->version = unknown_ver; modp->name = xstrdup(mod_basename); dlinkAdd(modp, &modp->node, &modules_list); if (modp->modinit) modp->modinit(); if (warn == 1) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Module %s [version: %s handle: %p] loaded.", modp->name, modp->version, tmpptr); ilog(LOG_TYPE_IRCD, "Module %s [version: %s handle: %p] loaded.", modp->name, modp->version, tmpptr); } return 0; } /* * modules_init * * input - NONE * output - NONE * side effects - The basic module manipulation modules are loaded */ void modules_init(void) { if (lt_dlinit()) { ilog(LOG_TYPE_IRCD, "Couldn't initialize the libltdl run time dynamic" " link library. Exiting."); exit(0); } } /* mod_find_path() * * input - path * output - none * side effects - returns a module path from path */ static struct module_path * mod_find_path(const char *path) { dlink_node *ptr; DLINK_FOREACH(ptr, mod_paths.head) { struct module_path *mpath = ptr->data; if (!strcmp(path, mpath->path)) return mpath; } return NULL; } /* mod_add_path() * * input - path * output - NONE * side effects - adds path to list */ void mod_add_path(const char *path) { struct module_path *pathst; if (mod_find_path(path)) return; pathst = MyMalloc(sizeof(struct module_path)); strlcpy(pathst->path, path, sizeof(pathst->path)); dlinkAdd(pathst, &pathst->node, &mod_paths); } /* add_conf_module * * input - module name * output - NONE * side effects - adds module to conf_mod */ void add_conf_module(const char *name) { struct module_path *pathst; pathst = MyMalloc(sizeof(struct module_path)); strlcpy(pathst->path, name, sizeof(pathst->path)); dlinkAdd(pathst, &pathst->node, &conf_modules); } /* mod_clear_paths() * * input - NONE * output - NONE * side effects - clear the lists of paths and conf modules */ void mod_clear_paths(void) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, mod_paths.head) { dlinkDelete(ptr, &mod_paths); MyFree(ptr->data); } DLINK_FOREACH_SAFE(ptr, next_ptr, conf_modules.head) { dlinkDelete(ptr, &conf_modules); MyFree(ptr->data); } } /* findmodule_byname * * input - name of module * output - NULL if not found or pointer to module * side effects - NONE */ struct module * findmodule_byname(const char *name) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, modules_list.head) { struct module *modp = ptr->data; if (strcmp(modp->name, name) == 0) return modp; } return NULL; } /* load_all_modules() * * input - int flag warn * output - NONE * side effects - load all modules found in autoload directory */ void load_all_modules(int warn) { DIR *system_module_dir = NULL; struct dirent *ldirent = NULL; char module_fq_name[HYB_PATH_MAX + 1]; if ((system_module_dir = opendir(AUTOMODPATH)) == NULL) { ilog(LOG_TYPE_IRCD, "Could not load modules from %s: %s", AUTOMODPATH, strerror(errno)); return; } while ((ldirent = readdir(system_module_dir)) != NULL) { if (modules_valid_suffix(ldirent->d_name)) { snprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", AUTOMODPATH, ldirent->d_name); load_a_module(module_fq_name, warn); } } closedir(system_module_dir); } /* load_conf_modules() * * input - NONE * output - NONE * side effects - load modules given in ircd.conf */ void load_conf_modules(void) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, conf_modules.head) { struct module_path *mpath = ptr->data; if (findmodule_byname(mpath->path) == NULL) load_one_module(mpath->path); } } /* load_core_modules() * * input - int flag warn * output - NONE * side effects - core modules are loaded, if any fail, kill ircd */ void load_core_modules(int warn) { char module_name[HYB_PATH_MAX + 1]; int i = 0; for (; core_module_table[i]; ++i) { snprintf(module_name, sizeof(module_name), "%s%s", MODPATH, core_module_table[i]); if (load_a_module(module_name, warn) == -1) { ilog(LOG_TYPE_IRCD, "Error loading core module %s: terminating ircd", core_module_table[i]); exit(EXIT_FAILURE); } } } /* load_one_module() * * input - pointer to path * - flagged as core module or not * output - -1 if error * side effects - module is loaded if found. */ int load_one_module(const char *path) { dlink_node *ptr = NULL; char modpath[HYB_PATH_MAX + 1]; struct stat statbuf; DLINK_FOREACH(ptr, mod_paths.head) { const struct module_path *mpath = ptr->data; snprintf(modpath, sizeof(modpath), "%s/%s", mpath->path, path); if (!modules_valid_suffix(path)) continue; if (strstr(modpath, "../") == NULL && strstr(modpath, "/..") == NULL) if (!stat(modpath, &statbuf)) if (S_ISREG(statbuf.st_mode)) /* Regular files only please */ return load_a_module(modpath, 1); } sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Cannot locate module %s", path); ilog(LOG_TYPE_IRCD, "Cannot locate module %s", path); return -1; } ircd-hybrid-8.1.13.dfsg.1/src/conf_parser.c0000644000175000017500000065322212263053413016452 0ustar domdom/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Copy the first part of user declarations. */ #line 25 "conf_parser.y" /* yacc.c:339 */ #define YY_NO_UNPUT #include #include #include "config.h" #include "stdinc.h" #include "ircd.h" #include "list.h" #include "conf.h" #include "conf_class.h" #include "event.h" #include "log.h" #include "client.h" /* for UMODE_ALL only */ #include "irc_string.h" #include "memory.h" #include "modules.h" #include "s_serv.h" #include "hostmask.h" #include "send.h" #include "listener.h" #include "resv.h" #include "numeric.h" #include "s_user.h" #include "motd.h" #ifdef HAVE_LIBCRYPTO #include #include #include #include #endif #include "rsa.h" int yylex(void); static struct { struct { dlink_list list; } mask, leaf, hub; struct { char buf[IRCD_BUFSIZE]; } name, user, host, addr, bind, file, ciph, cert, rpass, spass, class; struct { unsigned int value; } flags, modes, size, type, port, aftype, ping_freq, max_perip, con_freq, min_idle, max_idle, max_total, max_global, max_local, max_ident, max_sendq, max_recvq, cidr_bitlen_ipv4, cidr_bitlen_ipv6, number_per_cidr; } block_state; static void reset_block_state(void) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.mask.list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.leaf.list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.hub.list); free_dlink_node(ptr); } memset(&block_state, 0, sizeof(block_state)); } #line 181 "conf_parser.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ #ifndef YY_YY_CONF_PARSER_H_INCLUDED # define YY_YY_CONF_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { ACCEPT_PASSWORD = 258, ADMIN = 259, AFTYPE = 260, ANTI_NICK_FLOOD = 261, ANTI_SPAM_EXIT_MESSAGE_TIME = 262, AUTOCONN = 263, BYTES = 264, KBYTES = 265, MBYTES = 266, CALLER_ID_WAIT = 267, CAN_FLOOD = 268, CHANNEL = 269, CIDR_BITLEN_IPV4 = 270, CIDR_BITLEN_IPV6 = 271, CLASS = 272, CONNECT = 273, CONNECTFREQ = 274, CYCLE_ON_HOST_CHANGE = 275, DEFAULT_FLOODCOUNT = 276, DEFAULT_SPLIT_SERVER_COUNT = 277, DEFAULT_SPLIT_USER_COUNT = 278, DENY = 279, DESCRIPTION = 280, DIE = 281, DISABLE_AUTH = 282, DISABLE_FAKE_CHANNELS = 283, DISABLE_REMOTE_COMMANDS = 284, DOTS_IN_IDENT = 285, EGDPOOL_PATH = 286, EMAIL = 287, ENCRYPTED = 288, EXCEED_LIMIT = 289, EXEMPT = 290, FAILED_OPER_NOTICE = 291, FLATTEN_LINKS = 292, GECOS = 293, GENERAL = 294, GLINE = 295, GLINE_DURATION = 296, GLINE_ENABLE = 297, GLINE_EXEMPT = 298, GLINE_MIN_CIDR = 299, GLINE_MIN_CIDR6 = 300, GLINE_REQUEST_DURATION = 301, GLOBAL_KILL = 302, HAVENT_READ_CONF = 303, HIDDEN = 304, HIDDEN_NAME = 305, HIDE_IDLE_FROM_OPERS = 306, HIDE_SERVER_IPS = 307, HIDE_SERVERS = 308, HIDE_SERVICES = 309, HIDE_SPOOF_IPS = 310, HOST = 311, HUB = 312, HUB_MASK = 313, IGNORE_BOGUS_TS = 314, INVISIBLE_ON_CONNECT = 315, IP = 316, IRCD_AUTH = 317, IRCD_FLAGS = 318, IRCD_SID = 319, JOIN_FLOOD_COUNT = 320, JOIN_FLOOD_TIME = 321, KILL = 322, KILL_CHASE_TIME_LIMIT = 323, KLINE = 324, KLINE_EXEMPT = 325, KNOCK_DELAY = 326, KNOCK_DELAY_CHANNEL = 327, LEAF_MASK = 328, LINKS_DELAY = 329, LISTEN = 330, MASK = 331, MAX_ACCEPT = 332, MAX_BANS = 333, MAX_CHANS_PER_OPER = 334, MAX_CHANS_PER_USER = 335, MAX_GLOBAL = 336, MAX_IDENT = 337, MAX_IDLE = 338, MAX_LOCAL = 339, MAX_NICK_CHANGES = 340, MAX_NICK_LENGTH = 341, MAX_NICK_TIME = 342, MAX_NUMBER = 343, MAX_TARGETS = 344, MAX_TOPIC_LENGTH = 345, MAX_WATCH = 346, MIN_IDLE = 347, MIN_NONWILDCARD = 348, MIN_NONWILDCARD_SIMPLE = 349, MODULE = 350, MODULES = 351, MOTD = 352, NAME = 353, NEED_IDENT = 354, NEED_PASSWORD = 355, NETWORK_DESC = 356, NETWORK_NAME = 357, NICK = 358, NO_CREATE_ON_SPLIT = 359, NO_JOIN_ON_SPLIT = 360, NO_OPER_FLOOD = 361, NO_TILDE = 362, NUMBER = 363, NUMBER_PER_CIDR = 364, NUMBER_PER_IP = 365, OPER_ONLY_UMODES = 366, OPER_PASS_RESV = 367, OPER_UMODES = 368, OPERATOR = 369, OPERS_BYPASS_CALLERID = 370, PACE_WAIT = 371, PACE_WAIT_SIMPLE = 372, PASSWORD = 373, PATH = 374, PING_COOKIE = 375, PING_TIME = 376, PORT = 377, QSTRING = 378, RANDOM_IDLE = 379, REASON = 380, REDIRPORT = 381, REDIRSERV = 382, REHASH = 383, REMOTE = 384, REMOTEBAN = 385, RESV = 386, RESV_EXEMPT = 387, RSA_PRIVATE_KEY_FILE = 388, RSA_PUBLIC_KEY_FILE = 389, SECONDS = 390, MINUTES = 391, HOURS = 392, DAYS = 393, WEEKS = 394, MONTHS = 395, YEARS = 396, SEND_PASSWORD = 397, SENDQ = 398, SERVERHIDE = 399, SERVERINFO = 400, SHORT_MOTD = 401, SPOOF = 402, SPOOF_NOTICE = 403, SQUIT = 404, SSL_CERTIFICATE_FILE = 405, SSL_CERTIFICATE_FINGERPRINT = 406, SSL_CONNECTION_REQUIRED = 407, SSL_DH_PARAM_FILE = 408, STATS_E_DISABLED = 409, STATS_I_OPER_ONLY = 410, STATS_K_OPER_ONLY = 411, STATS_O_OPER_ONLY = 412, STATS_P_OPER_ONLY = 413, STATS_U_OPER_ONLY = 414, T_ALL = 415, T_BOTS = 416, T_CALLERID = 417, T_CCONN = 418, T_CLUSTER = 419, T_DEAF = 420, T_DEBUG = 421, T_DLINE = 422, T_EXTERNAL = 423, T_FARCONNECT = 424, T_FILE = 425, T_FULL = 426, T_GLOBOPS = 427, T_INVISIBLE = 428, T_IPV4 = 429, T_IPV6 = 430, T_LOCOPS = 431, T_LOG = 432, T_MAX_CLIENTS = 433, T_NCHANGE = 434, T_NONONREG = 435, T_OPERWALL = 436, T_RECVQ = 437, T_REJ = 438, T_RESTART = 439, T_SERVER = 440, T_SERVICE = 441, T_SERVICES_NAME = 442, T_SERVNOTICE = 443, T_SET = 444, T_SHARED = 445, T_SIZE = 446, T_SKILL = 447, T_SOFTCALLERID = 448, T_SPY = 449, T_SSL = 450, T_SSL_CIPHER_LIST = 451, T_SSL_CLIENT_METHOD = 452, T_SSL_SERVER_METHOD = 453, T_SSLV3 = 454, T_TLSV1 = 455, T_UMODES = 456, T_UNAUTH = 457, T_UNDLINE = 458, T_UNLIMITED = 459, T_UNRESV = 460, T_UNXLINE = 461, T_WALLOP = 462, T_WALLOPS = 463, T_WEBIRC = 464, TBOOL = 465, THROTTLE_TIME = 466, TKLINE_EXPIRE_NOTICES = 467, TMASKED = 468, TRUE_NO_OPER_FLOOD = 469, TS_MAX_DELTA = 470, TS_WARN_DELTA = 471, TWODOTS = 472, TYPE = 473, UNKLINE = 474, USE_EGD = 475, USE_LOGGING = 476, USER = 477, VHOST = 478, VHOST6 = 479, WARN_NO_NLINE = 480, XLINE = 481 }; #endif /* Tokens. */ #define ACCEPT_PASSWORD 258 #define ADMIN 259 #define AFTYPE 260 #define ANTI_NICK_FLOOD 261 #define ANTI_SPAM_EXIT_MESSAGE_TIME 262 #define AUTOCONN 263 #define BYTES 264 #define KBYTES 265 #define MBYTES 266 #define CALLER_ID_WAIT 267 #define CAN_FLOOD 268 #define CHANNEL 269 #define CIDR_BITLEN_IPV4 270 #define CIDR_BITLEN_IPV6 271 #define CLASS 272 #define CONNECT 273 #define CONNECTFREQ 274 #define CYCLE_ON_HOST_CHANGE 275 #define DEFAULT_FLOODCOUNT 276 #define DEFAULT_SPLIT_SERVER_COUNT 277 #define DEFAULT_SPLIT_USER_COUNT 278 #define DENY 279 #define DESCRIPTION 280 #define DIE 281 #define DISABLE_AUTH 282 #define DISABLE_FAKE_CHANNELS 283 #define DISABLE_REMOTE_COMMANDS 284 #define DOTS_IN_IDENT 285 #define EGDPOOL_PATH 286 #define EMAIL 287 #define ENCRYPTED 288 #define EXCEED_LIMIT 289 #define EXEMPT 290 #define FAILED_OPER_NOTICE 291 #define FLATTEN_LINKS 292 #define GECOS 293 #define GENERAL 294 #define GLINE 295 #define GLINE_DURATION 296 #define GLINE_ENABLE 297 #define GLINE_EXEMPT 298 #define GLINE_MIN_CIDR 299 #define GLINE_MIN_CIDR6 300 #define GLINE_REQUEST_DURATION 301 #define GLOBAL_KILL 302 #define HAVENT_READ_CONF 303 #define HIDDEN 304 #define HIDDEN_NAME 305 #define HIDE_IDLE_FROM_OPERS 306 #define HIDE_SERVER_IPS 307 #define HIDE_SERVERS 308 #define HIDE_SERVICES 309 #define HIDE_SPOOF_IPS 310 #define HOST 311 #define HUB 312 #define HUB_MASK 313 #define IGNORE_BOGUS_TS 314 #define INVISIBLE_ON_CONNECT 315 #define IP 316 #define IRCD_AUTH 317 #define IRCD_FLAGS 318 #define IRCD_SID 319 #define JOIN_FLOOD_COUNT 320 #define JOIN_FLOOD_TIME 321 #define KILL 322 #define KILL_CHASE_TIME_LIMIT 323 #define KLINE 324 #define KLINE_EXEMPT 325 #define KNOCK_DELAY 326 #define KNOCK_DELAY_CHANNEL 327 #define LEAF_MASK 328 #define LINKS_DELAY 329 #define LISTEN 330 #define MASK 331 #define MAX_ACCEPT 332 #define MAX_BANS 333 #define MAX_CHANS_PER_OPER 334 #define MAX_CHANS_PER_USER 335 #define MAX_GLOBAL 336 #define MAX_IDENT 337 #define MAX_IDLE 338 #define MAX_LOCAL 339 #define MAX_NICK_CHANGES 340 #define MAX_NICK_LENGTH 341 #define MAX_NICK_TIME 342 #define MAX_NUMBER 343 #define MAX_TARGETS 344 #define MAX_TOPIC_LENGTH 345 #define MAX_WATCH 346 #define MIN_IDLE 347 #define MIN_NONWILDCARD 348 #define MIN_NONWILDCARD_SIMPLE 349 #define MODULE 350 #define MODULES 351 #define MOTD 352 #define NAME 353 #define NEED_IDENT 354 #define NEED_PASSWORD 355 #define NETWORK_DESC 356 #define NETWORK_NAME 357 #define NICK 358 #define NO_CREATE_ON_SPLIT 359 #define NO_JOIN_ON_SPLIT 360 #define NO_OPER_FLOOD 361 #define NO_TILDE 362 #define NUMBER 363 #define NUMBER_PER_CIDR 364 #define NUMBER_PER_IP 365 #define OPER_ONLY_UMODES 366 #define OPER_PASS_RESV 367 #define OPER_UMODES 368 #define OPERATOR 369 #define OPERS_BYPASS_CALLERID 370 #define PACE_WAIT 371 #define PACE_WAIT_SIMPLE 372 #define PASSWORD 373 #define PATH 374 #define PING_COOKIE 375 #define PING_TIME 376 #define PORT 377 #define QSTRING 378 #define RANDOM_IDLE 379 #define REASON 380 #define REDIRPORT 381 #define REDIRSERV 382 #define REHASH 383 #define REMOTE 384 #define REMOTEBAN 385 #define RESV 386 #define RESV_EXEMPT 387 #define RSA_PRIVATE_KEY_FILE 388 #define RSA_PUBLIC_KEY_FILE 389 #define SECONDS 390 #define MINUTES 391 #define HOURS 392 #define DAYS 393 #define WEEKS 394 #define MONTHS 395 #define YEARS 396 #define SEND_PASSWORD 397 #define SENDQ 398 #define SERVERHIDE 399 #define SERVERINFO 400 #define SHORT_MOTD 401 #define SPOOF 402 #define SPOOF_NOTICE 403 #define SQUIT 404 #define SSL_CERTIFICATE_FILE 405 #define SSL_CERTIFICATE_FINGERPRINT 406 #define SSL_CONNECTION_REQUIRED 407 #define SSL_DH_PARAM_FILE 408 #define STATS_E_DISABLED 409 #define STATS_I_OPER_ONLY 410 #define STATS_K_OPER_ONLY 411 #define STATS_O_OPER_ONLY 412 #define STATS_P_OPER_ONLY 413 #define STATS_U_OPER_ONLY 414 #define T_ALL 415 #define T_BOTS 416 #define T_CALLERID 417 #define T_CCONN 418 #define T_CLUSTER 419 #define T_DEAF 420 #define T_DEBUG 421 #define T_DLINE 422 #define T_EXTERNAL 423 #define T_FARCONNECT 424 #define T_FILE 425 #define T_FULL 426 #define T_GLOBOPS 427 #define T_INVISIBLE 428 #define T_IPV4 429 #define T_IPV6 430 #define T_LOCOPS 431 #define T_LOG 432 #define T_MAX_CLIENTS 433 #define T_NCHANGE 434 #define T_NONONREG 435 #define T_OPERWALL 436 #define T_RECVQ 437 #define T_REJ 438 #define T_RESTART 439 #define T_SERVER 440 #define T_SERVICE 441 #define T_SERVICES_NAME 442 #define T_SERVNOTICE 443 #define T_SET 444 #define T_SHARED 445 #define T_SIZE 446 #define T_SKILL 447 #define T_SOFTCALLERID 448 #define T_SPY 449 #define T_SSL 450 #define T_SSL_CIPHER_LIST 451 #define T_SSL_CLIENT_METHOD 452 #define T_SSL_SERVER_METHOD 453 #define T_SSLV3 454 #define T_TLSV1 455 #define T_UMODES 456 #define T_UNAUTH 457 #define T_UNDLINE 458 #define T_UNLIMITED 459 #define T_UNRESV 460 #define T_UNXLINE 461 #define T_WALLOP 462 #define T_WALLOPS 463 #define T_WEBIRC 464 #define TBOOL 465 #define THROTTLE_TIME 466 #define TKLINE_EXPIRE_NOTICES 467 #define TMASKED 468 #define TRUE_NO_OPER_FLOOD 469 #define TS_MAX_DELTA 470 #define TS_WARN_DELTA 471 #define TWODOTS 472 #define TYPE 473 #define UNKLINE 474 #define USE_EGD 475 #define USE_LOGGING 476 #define USER 477 #define VHOST 478 #define VHOST6 479 #define WARN_NO_NLINE 480 #define XLINE 481 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE YYSTYPE; union YYSTYPE { #line 140 "conf_parser.y" /* yacc.c:355 */ int number; char *string; #line 678 "conf_parser.c" /* yacc.c:355 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONF_PARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 693 "conf_parser.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 1236 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 233 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 291 /* YYNRULES -- Number of rules. */ #define YYNRULES 656 /* YYNSTATES -- Number of states. */ #define YYNSTATES 1287 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 481 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 231, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 232, 227, 2, 230, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 229, 2, 228, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 370, 370, 371, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 400, 400, 401, 405, 409, 413, 417, 421, 425, 429, 435, 435, 436, 437, 438, 439, 446, 449, 449, 450, 450, 450, 452, 458, 465, 467, 467, 468, 468, 469, 469, 470, 470, 471, 471, 472, 472, 473, 473, 474, 474, 475, 475, 476, 477, 480, 481, 483, 483, 484, 490, 498, 498, 499, 505, 513, 555, 614, 642, 650, 665, 680, 689, 703, 712, 740, 770, 795, 817, 839, 848, 850, 850, 851, 851, 852, 852, 854, 863, 872, 885, 884, 902, 902, 903, 903, 903, 905, 911, 920, 921, 921, 923, 923, 924, 926, 933, 933, 946, 947, 949, 949, 950, 950, 952, 960, 963, 969, 968, 974, 974, 975, 979, 983, 987, 991, 995, 999, 1003, 1007, 1018, 1017, 1097, 1097, 1098, 1098, 1098, 1099, 1099, 1099, 1100, 1100, 1101, 1102, 1102, 1104, 1110, 1116, 1122, 1133, 1139, 1145, 1156, 1163, 1162, 1168, 1168, 1169, 1173, 1177, 1181, 1185, 1189, 1193, 1197, 1201, 1205, 1209, 1213, 1217, 1221, 1225, 1229, 1233, 1237, 1241, 1245, 1249, 1256, 1255, 1261, 1261, 1262, 1266, 1270, 1274, 1278, 1282, 1286, 1290, 1294, 1298, 1302, 1306, 1310, 1314, 1318, 1322, 1326, 1330, 1334, 1338, 1342, 1346, 1350, 1361, 1360, 1421, 1421, 1422, 1423, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1432, 1433, 1434, 1435, 1436, 1438, 1444, 1450, 1456, 1462, 1468, 1474, 1480, 1486, 1492, 1499, 1505, 1511, 1517, 1526, 1536, 1535, 1541, 1541, 1542, 1546, 1557, 1556, 1563, 1562, 1567, 1567, 1568, 1572, 1576, 1582, 1582, 1583, 1583, 1583, 1583, 1583, 1585, 1585, 1587, 1587, 1589, 1603, 1623, 1629, 1639, 1638, 1680, 1680, 1681, 1681, 1681, 1681, 1682, 1682, 1682, 1683, 1683, 1685, 1691, 1697, 1703, 1715, 1714, 1720, 1720, 1721, 1725, 1729, 1733, 1737, 1741, 1745, 1749, 1753, 1757, 1763, 1777, 1786, 1800, 1799, 1814, 1814, 1815, 1815, 1815, 1815, 1817, 1823, 1829, 1839, 1841, 1841, 1842, 1842, 1844, 1860, 1859, 1884, 1884, 1885, 1885, 1885, 1885, 1887, 1893, 1913, 1912, 1918, 1918, 1919, 1923, 1927, 1931, 1935, 1939, 1943, 1947, 1951, 1955, 1965, 1964, 1985, 1985, 1986, 1986, 1986, 1988, 1995, 1994, 2000, 2000, 2001, 2005, 2009, 2013, 2017, 2021, 2025, 2029, 2033, 2037, 2047, 2046, 2118, 2118, 2119, 2119, 2119, 2120, 2120, 2121, 2122, 2122, 2122, 2123, 2123, 2123, 2124, 2124, 2125, 2127, 2133, 2139, 2145, 2158, 2171, 2177, 2183, 2187, 2196, 2195, 2200, 2200, 2201, 2205, 2211, 2222, 2228, 2234, 2240, 2256, 2255, 2281, 2281, 2282, 2282, 2282, 2284, 2304, 2314, 2313, 2340, 2340, 2341, 2341, 2341, 2343, 2349, 2358, 2360, 2360, 2361, 2361, 2363, 2381, 2380, 2403, 2403, 2404, 2404, 2404, 2406, 2412, 2421, 2424, 2424, 2425, 2425, 2426, 2426, 2427, 2427, 2428, 2428, 2429, 2429, 2430, 2431, 2432, 2432, 2433, 2433, 2434, 2434, 2435, 2435, 2436, 2437, 2437, 2438, 2438, 2439, 2439, 2440, 2440, 2441, 2441, 2442, 2442, 2443, 2443, 2444, 2444, 2445, 2446, 2447, 2447, 2448, 2448, 2449, 2450, 2451, 2452, 2452, 2453, 2454, 2457, 2462, 2468, 2474, 2480, 2486, 2491, 2496, 2501, 2506, 2511, 2516, 2521, 2526, 2531, 2536, 2541, 2546, 2551, 2557, 2568, 2573, 2578, 2583, 2588, 2593, 2598, 2601, 2606, 2609, 2614, 2619, 2624, 2629, 2634, 2639, 2644, 2649, 2654, 2659, 2664, 2669, 2678, 2687, 2692, 2697, 2703, 2702, 2707, 2707, 2708, 2711, 2714, 2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747, 2750, 2753, 2756, 2759, 2762, 2765, 2768, 2774, 2773, 2778, 2778, 2779, 2782, 2785, 2788, 2791, 2794, 2797, 2800, 2803, 2806, 2809, 2812, 2815, 2818, 2821, 2824, 2827, 2830, 2833, 2836, 2839, 2844, 2849, 2854, 2863, 2866, 2866, 2867, 2868, 2868, 2869, 2869, 2870, 2871, 2872, 2873, 2874, 2874, 2875, 2875, 2877, 2882, 2887, 2892, 2897, 2902, 2907, 2912, 2917, 2922, 2927, 2932, 2940, 2943, 2943, 2944, 2944, 2945, 2946, 2947, 2948, 2948, 2949, 2950, 2952, 2958, 2964, 2970, 2976, 2985, 2999, 3005 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "ACCEPT_PASSWORD", "ADMIN", "AFTYPE", "ANTI_NICK_FLOOD", "ANTI_SPAM_EXIT_MESSAGE_TIME", "AUTOCONN", "BYTES", "KBYTES", "MBYTES", "CALLER_ID_WAIT", "CAN_FLOOD", "CHANNEL", "CIDR_BITLEN_IPV4", "CIDR_BITLEN_IPV6", "CLASS", "CONNECT", "CONNECTFREQ", "CYCLE_ON_HOST_CHANGE", "DEFAULT_FLOODCOUNT", "DEFAULT_SPLIT_SERVER_COUNT", "DEFAULT_SPLIT_USER_COUNT", "DENY", "DESCRIPTION", "DIE", "DISABLE_AUTH", "DISABLE_FAKE_CHANNELS", "DISABLE_REMOTE_COMMANDS", "DOTS_IN_IDENT", "EGDPOOL_PATH", "EMAIL", "ENCRYPTED", "EXCEED_LIMIT", "EXEMPT", "FAILED_OPER_NOTICE", "FLATTEN_LINKS", "GECOS", "GENERAL", "GLINE", "GLINE_DURATION", "GLINE_ENABLE", "GLINE_EXEMPT", "GLINE_MIN_CIDR", "GLINE_MIN_CIDR6", "GLINE_REQUEST_DURATION", "GLOBAL_KILL", "HAVENT_READ_CONF", "HIDDEN", "HIDDEN_NAME", "HIDE_IDLE_FROM_OPERS", "HIDE_SERVER_IPS", "HIDE_SERVERS", "HIDE_SERVICES", "HIDE_SPOOF_IPS", "HOST", "HUB", "HUB_MASK", "IGNORE_BOGUS_TS", "INVISIBLE_ON_CONNECT", "IP", "IRCD_AUTH", "IRCD_FLAGS", "IRCD_SID", "JOIN_FLOOD_COUNT", "JOIN_FLOOD_TIME", "KILL", "KILL_CHASE_TIME_LIMIT", "KLINE", "KLINE_EXEMPT", "KNOCK_DELAY", "KNOCK_DELAY_CHANNEL", "LEAF_MASK", "LINKS_DELAY", "LISTEN", "MASK", "MAX_ACCEPT", "MAX_BANS", "MAX_CHANS_PER_OPER", "MAX_CHANS_PER_USER", "MAX_GLOBAL", "MAX_IDENT", "MAX_IDLE", "MAX_LOCAL", "MAX_NICK_CHANGES", "MAX_NICK_LENGTH", "MAX_NICK_TIME", "MAX_NUMBER", "MAX_TARGETS", "MAX_TOPIC_LENGTH", "MAX_WATCH", "MIN_IDLE", "MIN_NONWILDCARD", "MIN_NONWILDCARD_SIMPLE", "MODULE", "MODULES", "MOTD", "NAME", "NEED_IDENT", "NEED_PASSWORD", "NETWORK_DESC", "NETWORK_NAME", "NICK", "NO_CREATE_ON_SPLIT", "NO_JOIN_ON_SPLIT", "NO_OPER_FLOOD", "NO_TILDE", "NUMBER", "NUMBER_PER_CIDR", "NUMBER_PER_IP", "OPER_ONLY_UMODES", "OPER_PASS_RESV", "OPER_UMODES", "OPERATOR", "OPERS_BYPASS_CALLERID", "PACE_WAIT", "PACE_WAIT_SIMPLE", "PASSWORD", "PATH", "PING_COOKIE", "PING_TIME", "PORT", "QSTRING", "RANDOM_IDLE", "REASON", "REDIRPORT", "REDIRSERV", "REHASH", "REMOTE", "REMOTEBAN", "RESV", "RESV_EXEMPT", "RSA_PRIVATE_KEY_FILE", "RSA_PUBLIC_KEY_FILE", "SECONDS", "MINUTES", "HOURS", "DAYS", "WEEKS", "MONTHS", "YEARS", "SEND_PASSWORD", "SENDQ", "SERVERHIDE", "SERVERINFO", "SHORT_MOTD", "SPOOF", "SPOOF_NOTICE", "SQUIT", "SSL_CERTIFICATE_FILE", "SSL_CERTIFICATE_FINGERPRINT", "SSL_CONNECTION_REQUIRED", "SSL_DH_PARAM_FILE", "STATS_E_DISABLED", "STATS_I_OPER_ONLY", "STATS_K_OPER_ONLY", "STATS_O_OPER_ONLY", "STATS_P_OPER_ONLY", "STATS_U_OPER_ONLY", "T_ALL", "T_BOTS", "T_CALLERID", "T_CCONN", "T_CLUSTER", "T_DEAF", "T_DEBUG", "T_DLINE", "T_EXTERNAL", "T_FARCONNECT", "T_FILE", "T_FULL", "T_GLOBOPS", "T_INVISIBLE", "T_IPV4", "T_IPV6", "T_LOCOPS", "T_LOG", "T_MAX_CLIENTS", "T_NCHANGE", "T_NONONREG", "T_OPERWALL", "T_RECVQ", "T_REJ", "T_RESTART", "T_SERVER", "T_SERVICE", "T_SERVICES_NAME", "T_SERVNOTICE", "T_SET", "T_SHARED", "T_SIZE", "T_SKILL", "T_SOFTCALLERID", "T_SPY", "T_SSL", "T_SSL_CIPHER_LIST", "T_SSL_CLIENT_METHOD", "T_SSL_SERVER_METHOD", "T_SSLV3", "T_TLSV1", "T_UMODES", "T_UNAUTH", "T_UNDLINE", "T_UNLIMITED", "T_UNRESV", "T_UNXLINE", "T_WALLOP", "T_WALLOPS", "T_WEBIRC", "TBOOL", "THROTTLE_TIME", "TKLINE_EXPIRE_NOTICES", "TMASKED", "TRUE_NO_OPER_FLOOD", "TS_MAX_DELTA", "TS_WARN_DELTA", "TWODOTS", "TYPE", "UNKLINE", "USE_EGD", "USE_LOGGING", "USER", "VHOST", "VHOST6", "WARN_NO_NLINE", "XLINE", "';'", "'}'", "'{'", "'='", "','", "':'", "$accept", "conf", "conf_item", "timespec_", "timespec", "sizespec_", "sizespec", "modules_entry", "modules_items", "modules_item", "modules_module", "modules_path", "serverinfo_entry", "serverinfo_items", "serverinfo_item", "serverinfo_ssl_client_method", "serverinfo_ssl_server_method", "client_method_types", "client_method_type_item", "server_method_types", "server_method_type_item", "serverinfo_ssl_certificate_file", "serverinfo_rsa_private_key_file", "serverinfo_ssl_dh_param_file", "serverinfo_ssl_cipher_list", "serverinfo_name", "serverinfo_sid", "serverinfo_description", "serverinfo_network_name", "serverinfo_network_desc", "serverinfo_vhost", "serverinfo_vhost6", "serverinfo_max_clients", "serverinfo_max_nick_length", "serverinfo_max_topic_length", "serverinfo_hub", "admin_entry", "admin_items", "admin_item", "admin_name", "admin_email", "admin_description", "motd_entry", "$@1", "motd_items", "motd_item", "motd_mask", "motd_file", "logging_entry", "logging_items", "logging_item", "logging_use_logging", "logging_file_entry", "$@2", "logging_file_items", "logging_file_item", "logging_file_name", "logging_file_size", "logging_file_type", "$@3", "logging_file_type_items", "logging_file_type_item", "oper_entry", "$@4", "oper_items", "oper_item", "oper_name", "oper_user", "oper_password", "oper_encrypted", "oper_rsa_public_key_file", "oper_ssl_certificate_fingerprint", "oper_ssl_connection_required", "oper_class", "oper_umodes", "$@5", "oper_umodes_items", "oper_umodes_item", "oper_flags", "$@6", "oper_flags_items", "oper_flags_item", "class_entry", "$@7", "class_items", "class_item", "class_name", "class_ping_time", "class_number_per_ip", "class_connectfreq", "class_max_number", "class_max_global", "class_max_local", "class_max_ident", "class_sendq", "class_recvq", "class_cidr_bitlen_ipv4", "class_cidr_bitlen_ipv6", "class_number_per_cidr", "class_min_idle", "class_max_idle", "class_flags", "$@8", "class_flags_items", "class_flags_item", "listen_entry", "$@9", "listen_flags", "$@10", "listen_flags_items", "listen_flags_item", "listen_items", "listen_item", "listen_port", "$@11", "port_items", "port_item", "listen_address", "listen_host", "auth_entry", "$@12", "auth_items", "auth_item", "auth_user", "auth_passwd", "auth_class", "auth_encrypted", "auth_flags", "$@13", "auth_flags_items", "auth_flags_item", "auth_spoof", "auth_redir_serv", "auth_redir_port", "resv_entry", "$@14", "resv_items", "resv_item", "resv_mask", "resv_reason", "resv_exempt", "service_entry", "service_items", "service_item", "service_name", "shared_entry", "$@15", "shared_items", "shared_item", "shared_name", "shared_user", "shared_type", "$@16", "shared_types", "shared_type_item", "cluster_entry", "$@17", "cluster_items", "cluster_item", "cluster_name", "cluster_type", "$@18", "cluster_types", "cluster_type_item", "connect_entry", "$@19", "connect_items", "connect_item", "connect_name", "connect_host", "connect_vhost", "connect_send_password", "connect_accept_password", "connect_ssl_certificate_fingerprint", "connect_port", "connect_aftype", "connect_flags", "$@20", "connect_flags_items", "connect_flags_item", "connect_encrypted", "connect_hub_mask", "connect_leaf_mask", "connect_class", "connect_ssl_cipher_list", "kill_entry", "$@21", "kill_items", "kill_item", "kill_user", "kill_reason", "deny_entry", "$@22", "deny_items", "deny_item", "deny_ip", "deny_reason", "exempt_entry", "exempt_items", "exempt_item", "exempt_ip", "gecos_entry", "$@23", "gecos_items", "gecos_item", "gecos_name", "gecos_reason", "general_entry", "general_items", "general_item", "general_max_watch", "general_cycle_on_host_change", "general_gline_enable", "general_gline_duration", "general_gline_request_duration", "general_gline_min_cidr", "general_gline_min_cidr6", "general_tkline_expire_notices", "general_kill_chase_time_limit", "general_hide_spoof_ips", "general_ignore_bogus_ts", "general_failed_oper_notice", "general_anti_nick_flood", "general_max_nick_time", "general_max_nick_changes", "general_max_accept", "general_anti_spam_exit_message_time", "general_ts_warn_delta", "general_ts_max_delta", "general_havent_read_conf", "general_invisible_on_connect", "general_warn_no_nline", "general_stats_e_disabled", "general_stats_o_oper_only", "general_stats_P_oper_only", "general_stats_u_oper_only", "general_stats_k_oper_only", "general_stats_i_oper_only", "general_pace_wait", "general_caller_id_wait", "general_opers_bypass_callerid", "general_pace_wait_simple", "general_short_motd", "general_no_oper_flood", "general_true_no_oper_flood", "general_oper_pass_resv", "general_dots_in_ident", "general_max_targets", "general_use_egd", "general_egdpool_path", "general_services_name", "general_ping_cookie", "general_disable_auth", "general_throttle_time", "general_oper_umodes", "$@24", "umode_oitems", "umode_oitem", "general_oper_only_umodes", "$@25", "umode_items", "umode_item", "general_min_nonwildcard", "general_min_nonwildcard_simple", "general_default_floodcount", "channel_entry", "channel_items", "channel_item", "channel_disable_fake_channels", "channel_knock_delay", "channel_knock_delay_channel", "channel_max_chans_per_user", "channel_max_chans_per_oper", "channel_max_bans", "channel_default_split_user_count", "channel_default_split_server_count", "channel_no_create_on_split", "channel_no_join_on_split", "channel_jflood_count", "channel_jflood_time", "serverhide_entry", "serverhide_items", "serverhide_item", "serverhide_flatten_links", "serverhide_disable_remote_commands", "serverhide_hide_servers", "serverhide_hide_services", "serverhide_hidden_name", "serverhide_links_delay", "serverhide_hidden", "serverhide_hide_server_ips", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 59, 125, 123, 61, 44, 58 }; # endif #define YYPACT_NINF -755 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-755))) #define YYTABLE_NINF -124 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -755, 716, -755, -198, -223, -208, -755, -755, -755, -186, -755, -184, -755, -755, -755, -179, -755, -755, -755, -168, -154, -755, -146, -123, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 282, 923, -84, -59, -46, 130, -45, 414, -39, -26, -19, 79, -18, -11, 21, 503, 408, 40, 39, 53, 41, -14, -1, 64, 66, 7, -755, -755, -755, -755, -755, 81, 82, 96, 100, 102, 104, 105, 117, 119, 121, 127, 128, 13, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 706, 577, 61, -755, 131, 10, -755, -755, 36, -755, 132, 133, 135, 139, 141, 142, 143, 144, 146, 148, 151, 153, 157, 158, 160, 162, 164, 165, 166, 168, 170, 180, 182, 183, 187, 188, 189, -755, 192, -755, 193, 195, 197, 199, 200, 201, 202, 206, 207, 208, 209, 212, 213, 216, 217, 219, 221, 222, 223, 108, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 353, 8, 292, 29, 227, 231, 24, -755, -755, -755, 22, 546, 47, -755, 236, 237, 240, 246, 248, 251, 253, 254, 15, -755, -755, -755, -755, -755, -755, -755, -755, -755, 60, 255, 257, 259, 260, 262, 263, 265, 266, 272, 288, 291, 294, 303, 305, 306, 307, 308, 9, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 4, 65, 309, 19, -755, -755, -755, 155, -755, 313, 23, -755, -755, 62, -755, 215, 352, 365, 270, -755, 252, 436, 335, 438, 440, 440, 440, 443, 451, 454, 355, 356, 340, -755, 347, 346, 351, 354, -755, 357, 359, 360, 362, 366, 367, 368, 369, 370, 372, 373, 377, 258, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 358, 378, 381, 382, 383, 384, 385, -755, 386, 387, 388, 390, 391, 392, 393, 326, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 394, 397, 69, -755, -755, -755, 460, 409, -755, -755, 407, 411, 48, -755, -755, -755, 428, 440, 440, 432, 487, 433, 537, 523, 437, 440, 439, 540, 543, 440, 545, 445, 446, 447, 440, 550, 551, 440, 552, 553, 554, 555, 455, 441, 456, 442, 457, 440, 440, 458, 459, 464, 58, 95, 466, 467, 468, 547, 440, 469, 471, 440, 440, 472, 473, 461, -755, 462, 463, 465, -755, 474, 476, 480, 481, 482, 163, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 484, 485, 50, -755, -755, -755, 475, 488, 493, -755, 494, -755, 25, -755, -755, -755, -755, -755, 561, 562, 499, -755, 502, 501, 505, 18, -755, -755, -755, 509, 507, 508, -755, 511, 512, 514, 515, 516, -755, 518, 14, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 522, 526, 527, 528, 11, -755, -755, -755, -755, 477, 529, 549, 563, 556, 557, 560, 440, 533, -755, -755, 567, 564, 569, 586, 595, 630, 638, 639, 641, 642, 648, 664, 652, -99, -42, 653, 654, 558, -755, 559, 566, -755, 73, -755, -755, -755, -755, 570, 574, -755, 568, 656, 575, -755, 576, 579, -755, 580, 27, -755, -755, -755, -755, 578, 584, 587, -755, 590, 591, 592, 593, 267, 597, 605, 607, 615, 617, 618, 619, 623, -755, -755, 673, 674, 440, 625, 676, 685, 440, 698, 699, 440, 734, 751, 755, 440, 762, 762, 646, -755, -755, 752, 129, 754, 668, 758, 764, 655, 766, 767, 784, 771, 775, 776, 777, 677, -755, 778, 780, 686, -755, 689, -755, 797, 798, 696, -755, 701, 704, 705, 708, 709, 710, 714, 715, 717, 722, 723, 725, 728, 729, 730, 731, 732, 733, 735, 737, 738, 739, 740, 741, 742, 743, 744, 660, 745, 703, 747, 748, 749, 750, 753, 756, 757, 759, 760, 769, 770, 772, 773, 781, 782, 783, 785, 788, 789, 790, 791, -755, -755, 807, 763, 713, 810, 853, 855, 856, 858, 792, -755, 859, 862, 793, -755, -755, 868, 875, 774, 897, 794, -755, 795, 796, -755, -755, 884, 888, 799, -755, -755, 891, 814, 800, 902, 906, 908, 909, 823, 804, 912, 809, -755, -755, 914, 915, 916, 813, -755, 815, 816, 817, 818, 819, 820, 821, 822, -755, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, -755, -755, -209, -755, -755, -755, -189, -755, 837, 838, -755, -755, 918, 839, 840, -755, 841, -755, 26, 843, -755, -755, 927, 842, 943, 844, -755, -755, -755, -755, -755, -755, -755, -755, 440, 440, 440, 440, 440, 440, 440, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 846, 847, 848, -34, 849, 850, 851, 852, 854, 857, 860, 861, 863, 864, 289, 865, 866, -755, 867, 869, 870, 871, 872, 873, 874, 5, 876, 877, 878, 879, 880, 881, 882, -755, 883, 885, -755, -755, 886, 887, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -174, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -172, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 889, 890, 245, 892, 893, 894, 895, 896, -755, 898, 899, -755, 900, 901, -16, 907, 903, -755, -755, -755, -755, 904, 905, -755, 910, 911, 524, 913, 917, 919, 920, 921, 746, 922, -755, 924, 925, 926, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -99, -755, -42, -755, -755, 928, 632, -755, -755, 929, 930, 931, -755, 57, -755, -755, -755, -755, -755, 932, 787, 935, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -171, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 762, 762, 762, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -155, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 660, -755, 703, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -50, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -49, -755, 972, 897, 936, -755, -755, -755, -755, -755, 933, -755, -755, 934, -755, -755, -755, -755, 937, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -23, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -15, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 0, -755, -755, 959, -101, 938, 940, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 30, -755, -755, -755, -34, -755, -755, -755, -755, 5, -755, -755, -755, 245, -755, -16, -755, -755, -755, 954, 956, 957, -755, 524, -755, 746, -755, 632, 944, 945, 946, 297, -755, -755, 787, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 55, -755, -755, -755, 297, -755 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint16 yydefact[] = { 2, 0, 1, 0, 0, 0, 222, 385, 433, 0, 448, 0, 288, 424, 264, 0, 107, 147, 322, 0, 0, 363, 0, 0, 339, 3, 23, 11, 4, 24, 5, 6, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 22, 21, 7, 12, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 102, 101, 624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 611, 623, 613, 614, 615, 616, 612, 617, 618, 619, 620, 621, 622, 0, 0, 0, 446, 0, 0, 444, 445, 0, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 581, 0, 556, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459, 506, 508, 500, 501, 502, 503, 504, 499, 470, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 496, 471, 472, 505, 474, 479, 480, 475, 477, 476, 490, 491, 478, 481, 482, 483, 484, 473, 486, 487, 488, 507, 497, 498, 495, 489, 485, 493, 494, 492, 0, 0, 0, 0, 0, 0, 0, 45, 46, 47, 0, 0, 0, 648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 639, 640, 641, 642, 643, 646, 644, 645, 647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 68, 69, 67, 64, 63, 70, 54, 66, 57, 58, 59, 55, 65, 60, 61, 62, 56, 0, 0, 0, 0, 118, 119, 120, 0, 337, 0, 0, 335, 336, 0, 103, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 610, 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 226, 229, 231, 232, 233, 234, 235, 236, 237, 238, 227, 228, 230, 239, 240, 241, 0, 0, 0, 0, 0, 0, 0, 413, 0, 0, 0, 0, 0, 0, 0, 0, 388, 389, 390, 391, 392, 393, 394, 396, 395, 398, 402, 399, 400, 401, 397, 439, 0, 0, 0, 436, 437, 438, 0, 0, 443, 454, 0, 0, 0, 451, 452, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 458, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 291, 292, 293, 294, 299, 295, 296, 297, 298, 430, 0, 0, 0, 427, 428, 429, 0, 0, 0, 266, 0, 276, 0, 274, 275, 277, 278, 48, 0, 0, 0, 44, 0, 0, 0, 0, 110, 111, 112, 0, 0, 0, 195, 0, 0, 0, 0, 0, 170, 0, 0, 150, 151, 152, 153, 156, 157, 158, 159, 155, 154, 160, 0, 0, 0, 0, 0, 325, 326, 327, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 638, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 371, 0, 366, 367, 368, 121, 0, 0, 117, 0, 0, 0, 334, 0, 0, 349, 0, 0, 342, 343, 344, 345, 0, 0, 0, 97, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 609, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 403, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 387, 0, 0, 0, 435, 0, 442, 0, 0, 0, 450, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 457, 300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0, 426, 279, 0, 0, 0, 0, 0, 273, 0, 0, 43, 113, 0, 0, 0, 109, 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 329, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 0, 75, 80, 81, 0, 79, 0, 0, 51, 369, 0, 0, 0, 365, 0, 116, 0, 0, 333, 346, 0, 0, 0, 0, 341, 106, 105, 104, 632, 631, 625, 635, 27, 27, 27, 27, 27, 27, 27, 29, 28, 636, 626, 627, 630, 629, 628, 633, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 386, 0, 0, 434, 447, 0, 0, 449, 522, 526, 541, 511, 608, 554, 548, 551, 521, 513, 512, 515, 516, 514, 529, 519, 520, 530, 518, 525, 524, 523, 549, 510, 606, 607, 545, 591, 585, 602, 586, 587, 588, 596, 605, 589, 599, 603, 592, 604, 597, 593, 598, 590, 601, 595, 594, 600, 0, 584, 547, 565, 560, 577, 561, 562, 563, 571, 580, 564, 574, 578, 567, 579, 572, 568, 573, 566, 576, 570, 569, 575, 0, 559, 542, 540, 543, 553, 544, 532, 538, 539, 536, 537, 533, 534, 535, 552, 555, 517, 546, 528, 527, 550, 531, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 425, 0, 0, 0, 284, 280, 283, 265, 49, 50, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 0, 0, 0, 323, 650, 649, 655, 653, 656, 651, 652, 654, 88, 96, 87, 94, 95, 86, 90, 89, 83, 82, 84, 93, 85, 72, 0, 73, 0, 91, 92, 0, 0, 364, 122, 0, 0, 0, 134, 0, 126, 127, 129, 128, 338, 0, 0, 0, 340, 30, 31, 32, 33, 34, 35, 36, 253, 254, 246, 263, 262, 0, 261, 248, 250, 257, 249, 247, 256, 243, 255, 245, 244, 37, 37, 37, 39, 38, 251, 252, 408, 411, 412, 422, 419, 405, 420, 417, 418, 0, 416, 421, 404, 410, 407, 409, 423, 406, 440, 441, 455, 456, 582, 0, 557, 0, 303, 304, 313, 310, 315, 311, 312, 318, 314, 316, 309, 317, 0, 308, 302, 321, 320, 319, 301, 432, 431, 287, 286, 271, 272, 270, 0, 269, 0, 0, 0, 114, 115, 169, 165, 214, 202, 211, 210, 200, 205, 221, 213, 219, 204, 207, 216, 218, 215, 212, 220, 208, 217, 206, 209, 0, 198, 162, 164, 166, 167, 168, 179, 174, 191, 175, 176, 177, 185, 194, 178, 188, 192, 181, 193, 186, 182, 187, 180, 190, 184, 183, 189, 0, 173, 163, 332, 330, 331, 74, 78, 370, 375, 381, 384, 377, 383, 378, 382, 380, 376, 379, 0, 374, 130, 0, 0, 0, 0, 125, 347, 353, 359, 362, 355, 361, 356, 360, 358, 354, 357, 0, 352, 348, 259, 0, 40, 41, 42, 414, 0, 583, 558, 306, 0, 267, 0, 285, 282, 281, 0, 0, 0, 196, 0, 171, 0, 372, 0, 0, 0, 0, 0, 124, 350, 0, 260, 415, 307, 268, 201, 199, 203, 197, 172, 373, 131, 133, 132, 140, 145, 144, 139, 142, 146, 143, 138, 141, 0, 137, 351, 135, 0, 136 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -755, -755, -755, -298, -307, -754, -621, -755, -755, 942, -755, -755, -755, -755, 845, -755, -755, -755, 72, -755, 77, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 1015, -755, -755, -755, -755, -755, -755, 620, -755, -755, -755, -755, 939, -755, -755, -755, -755, 93, -755, -755, -755, -755, -755, -170, -755, -755, -755, 622, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -119, -755, -755, -755, -114, -755, -755, -755, 803, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -92, -755, -755, -755, -755, -755, -98, -755, 657, -755, -755, -755, 38, -755, -755, -755, -755, -755, 681, -755, -755, -755, -755, -755, -755, -755, -87, -755, -755, -755, -755, -755, -755, 616, -755, -755, -755, -755, -755, 941, -755, -755, -755, -755, 571, -755, -755, -755, -755, -755, -100, -755, -755, -755, 608, -755, -755, -755, -755, -94, -755, -755, -755, 805, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -57, -755, -755, -755, -755, -755, -755, -755, -755, 702, -755, -755, -755, -755, -755, 801, -755, -755, -755, -755, 1067, -755, -755, -755, -755, 786, -755, -755, -755, -755, 1014, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 78, -755, -755, -755, 83, -755, -755, -755, -755, -755, 1089, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, -755, 947, -755, -755, -755, -755, -755, -755, -755, -755 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 25, 816, 817, 1073, 1074, 26, 222, 223, 224, 225, 27, 266, 267, 268, 269, 777, 778, 781, 782, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 28, 74, 75, 76, 77, 78, 29, 61, 498, 499, 500, 501, 30, 288, 289, 290, 291, 292, 1036, 1037, 1038, 1039, 1040, 1210, 1281, 1282, 31, 62, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 743, 1186, 1187, 524, 737, 1158, 1159, 32, 51, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 610, 1058, 1059, 33, 59, 484, 722, 1129, 1130, 485, 486, 487, 1133, 978, 979, 488, 489, 34, 57, 462, 463, 464, 465, 466, 467, 468, 707, 1115, 1116, 469, 470, 471, 35, 63, 529, 530, 531, 532, 533, 36, 295, 296, 297, 37, 69, 583, 584, 585, 586, 587, 798, 1224, 1225, 38, 66, 567, 568, 569, 570, 788, 1205, 1206, 39, 52, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 632, 1086, 1087, 380, 381, 382, 383, 384, 40, 58, 475, 476, 477, 478, 41, 53, 388, 389, 390, 391, 42, 111, 112, 113, 43, 55, 398, 399, 400, 401, 44, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 431, 939, 940, 212, 429, 915, 916, 213, 214, 215, 45, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 46, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 841, 842, 597, 598, 599, 564, 49, 840, 70, 472, 248, 109, 525, 1084, 79, 502, 229, 1056, 1022, 495, 286, 50, 1023, 495, 293, 219, 479, 1032, 579, 47, 48, 503, 71, 1126, 249, 80, 81, 395, 1024, 72, 286, 82, 1025, 54, 230, 56, 526, 504, 525, 395, 60, 472, 231, 1099, 293, 1101, 1227, 1100, 1032, 1102, 1228, 64, 385, 579, 232, 233, 250, 234, 235, 236, 385, 110, 1232, 251, 564, 65, 1233, 505, 83, 84, 219, 480, 526, 67, 85, 86, 481, 527, 482, 237, 1057, 87, 88, 89, 496, 252, 653, 654, 496, 253, 775, 776, 565, 1253, 661, 73, 68, 254, 665, 115, 255, 256, 506, 670, 116, 117, 673, 90, 91, 220, 118, 294, 386, 527, 1033, 580, 683, 684, 119, 120, 386, 109, 507, 473, 396, 121, 528, 696, 122, 123, 699, 700, 257, 221, 124, 106, 396, 483, 508, 125, 126, 294, 127, 128, 129, 1033, 130, 779, 780, 258, 580, 397, 259, 131, 453, 509, 510, 132, 133, 1127, 107, 565, 528, 397, 220, 473, 134, 1236, 1238, 1128, 454, 1237, 1239, 108, 114, 135, 387, 260, 497, -123, 216, 110, 497, 136, 387, 137, 455, 138, 221, 139, 1085, 140, 141, 217, 1246, 261, 262, 263, 1247, -123, 218, 226, 1248, 299, 142, 511, 1249, 1034, 227, 143, 144, 145, 566, 146, 147, 148, 456, 1250, 149, 300, 474, 1251, 264, 265, 760, 303, 512, 562, 393, 751, 287, 317, 745, 542, 1035, 581, 732, 573, 1034, 582, 228, 577, 493, 724, 150, 800, 490, 1257, 1105, 319, 287, 1258, 151, 152, 153, 154, 155, 156, 688, 285, 298, 689, 474, 320, 321, 1035, 650, 322, 717, 1106, 581, 457, 1284, 70, 582, 1211, 1285, 544, 1107, 458, 459, 566, 571, 479, 301, 157, 302, 644, 1070, 1071, 1072, 789, 828, 845, 846, 690, 832, 71, 691, 835, 460, 305, 306, 839, 72, 1108, 1229, 1230, 1231, 158, 159, 323, 160, 161, 162, 575, 307, 354, 163, 355, 308, 356, 309, 164, 310, 311, 451, 1272, 588, 324, 325, 326, 327, 357, 1109, 1110, 328, 312, 480, 313, 329, 314, 1111, 481, 453, 482, 330, 315, 316, 358, 592, 392, 402, 403, 1273, 404, 1274, 331, 332, 405, 454, 406, 407, 408, 409, 596, 410, 1112, 411, 333, 73, 412, 359, 413, 360, 461, 455, 414, 415, 361, 416, 713, 417, 1113, 418, 419, 420, 840, 421, 362, 422, 334, 809, 810, 811, 812, 813, 814, 815, 248, 423, 1275, 424, 425, 483, 115, 456, 426, 427, 428, 116, 117, 430, 432, 363, 433, 118, 434, 1276, 435, 436, 437, 438, 249, 119, 120, 439, 440, 441, 442, 335, 121, 443, 444, 122, 123, 445, 446, 364, 447, 124, 448, 449, 450, 1114, 125, 126, 491, 127, 128, 129, 492, 130, 1277, 1278, 250, 534, 535, 365, 131, 536, 457, 251, 132, 133, 589, 537, 366, 538, 458, 459, 539, 134, 540, 541, 545, 623, 546, 590, 547, 548, 135, 549, 550, 252, 551, 552, 591, 253, 136, 460, 137, 553, 138, 229, 139, 254, 140, 141, 255, 256, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 554, 1279, 142, 555, 367, 1280, 556, 143, 144, 145, 1138, 146, 147, 148, 230, 557, 149, 558, 559, 560, 561, 572, 231, 257, 1139, 576, 593, 594, 595, 502, 596, 368, 1140, 600, 232, 233, 640, 234, 235, 236, 258, 601, 150, 259, 602, 503, 1141, 603, 604, 605, 151, 152, 153, 154, 155, 156, 606, 461, 607, 237, 354, 504, 355, 608, 356, 646, 609, 625, 260, 611, 1254, 612, 613, 1142, 614, 1143, 357, 656, 615, 616, 617, 618, 619, 157, 620, 621, 261, 262, 263, 622, 626, 505, 358, 627, 628, 629, 630, 631, 633, 634, 635, 1144, 636, 637, 638, 639, 642, 158, 159, 643, 160, 161, 162, 264, 265, 359, 163, 360, 647, 648, 652, 164, 361, 649, 655, 657, 506, 658, 659, 660, 663, 662, 362, 664, 1145, 666, 1146, 667, 668, 669, 671, 672, 674, 675, 676, 677, 507, 678, 680, 682, 685, 686, 695, 679, 681, 1147, 687, 363, 692, 693, 694, 697, 508, 698, 701, 702, 726, 727, 756, 753, 703, 704, 762, 1148, 764, 705, 765, 706, 1149, 509, 510, 364, 1150, 1195, 719, 766, 708, 1151, 709, 319, 1152, 894, 710, 711, 712, 1153, 715, 716, 2, 3, 720, 365, 4, 320, 321, 721, 723, 322, 728, 1154, 366, 729, 5, 730, 1155, 6, 7, 731, 734, 735, 736, 754, 8, 738, 739, 1156, 740, 741, 742, 511, 744, 747, 1157, 9, 918, 767, 10, 11, 748, 749, 750, 755, 761, 768, 769, 1196, 770, 771, 757, 758, 512, 323, 759, 772, 773, 367, 763, 774, 783, 784, 12, 794, 791, 826, 827, 13, 830, 785, 786, 324, 325, 326, 327, 14, 1197, 831, 328, 1165, 787, 793, 329, 1198, 368, 792, 795, 796, 330, 802, 833, 834, 1199, 797, 799, 803, 15, 16, 804, 331, 332, 805, 806, 807, 808, 895, 896, 897, 818, 898, 899, 333, 900, 901, 17, 902, 819, 903, 820, 1200, 904, 1201, 1202, 905, 906, 907, 821, 908, 822, 823, 824, 18, 909, 334, 825, 1203, 910, 911, 912, 829, 1214, 836, 1204, 837, 19, 20, 913, 838, 919, 920, 921, 914, 922, 923, 840, 924, 925, 843, 926, 844, 927, 847, 848, 928, 21, 849, 929, 930, 931, 851, 932, 850, 335, 852, 853, 933, 854, 22, 855, 934, 935, 936, 856, 857, 858, 860, 23, 861, 859, 937, 24, 1166, 1167, 1168, 938, 1169, 1170, 862, 1171, 1172, 863, 1173, 1215, 1174, 864, 865, 1175, 866, 79, 1176, 1177, 1178, 867, 1179, 962, 868, 869, 965, 1180, 870, 871, 872, 1181, 1182, 1183, 873, 874, 964, 875, 80, 81, 1216, 1184, 876, 877, 82, 878, 1185, 1217, 879, 880, 881, 882, 883, 884, 966, 885, 1218, 886, 887, 888, 889, 890, 891, 892, 893, 917, 963, 941, 942, 943, 944, 967, 968, 945, 969, 971, 946, 947, 972, 948, 949, 83, 84, 1219, 974, 1220, 1221, 85, 86, 950, 951, 975, 952, 953, 87, 88, 89, 976, 977, 1222, 983, 954, 955, 956, 984, 957, 1223, 986, 958, 959, 960, 961, 970, 973, 980, 981, 982, 987, 989, 985, 90, 91, 990, 988, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1028, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1042, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1026, 1027, 1044, 1030, 1031, 1029, 1041, 1045, 1043, 1053, 1054, 1055, 1060, 1061, 1062, 1063, 1240, 1064, 1252, 1263, 1065, 1264, 1265, 1066, 1067, 304, 1068, 1069, 1075, 1076, 1077, 1192, 1078, 1079, 1080, 1081, 1082, 1083, 1193, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 563, 1096, 1097, 1098, 1286, 1103, 1104, 733, 1117, 1118, 1119, 1120, 1121, 1131, 1122, 1123, 1124, 1125, 1212, 1267, 1134, 1135, 1266, 1132, 746, 1259, 1136, 1137, 624, 1160, 1262, 725, 714, 1161, 752, 1162, 1163, 1164, 1188, 1261, 1189, 1190, 1191, 801, 1194, 1207, 1268, 1283, 1213, 1208, 1209, 1226, 1242, 494, 1243, 1244, 1256, 1255, 1245, 1241, 1269, 1270, 1271, 641, 790, 1260, 718, 394, 452, 1235, 318, 0, 1234, 651, 543, 0, 0, 0, 645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 574, 0, 0, 0, 0, 0, 0, 0, 0, 578 }; static const yytype_int16 yycheck[] = { 621, 622, 309, 310, 311, 1, 229, 108, 1, 1, 1, 1, 1, 8, 1, 1, 1, 51, 227, 1, 1, 229, 231, 1, 1, 1, 1, 1, 1, 227, 228, 17, 25, 49, 25, 22, 23, 1, 227, 32, 1, 28, 231, 229, 29, 229, 35, 33, 1, 1, 229, 1, 37, 227, 1, 227, 227, 231, 1, 231, 231, 229, 1, 1, 49, 50, 57, 52, 53, 54, 1, 61, 227, 64, 1, 229, 231, 63, 65, 66, 1, 56, 35, 229, 71, 72, 61, 76, 63, 74, 124, 78, 79, 80, 76, 86, 403, 404, 76, 90, 199, 200, 98, 204, 411, 98, 229, 98, 415, 1, 101, 102, 98, 420, 6, 7, 423, 104, 105, 95, 12, 98, 61, 76, 98, 98, 433, 434, 20, 21, 61, 1, 118, 125, 98, 27, 125, 444, 30, 31, 447, 448, 133, 119, 36, 229, 98, 122, 134, 41, 42, 98, 44, 45, 46, 98, 48, 199, 200, 150, 98, 125, 153, 55, 1, 151, 152, 59, 60, 185, 229, 98, 125, 125, 95, 125, 68, 227, 227, 195, 17, 231, 231, 229, 229, 77, 125, 178, 170, 170, 229, 61, 170, 85, 125, 87, 33, 89, 119, 91, 195, 93, 94, 229, 227, 196, 197, 198, 231, 170, 229, 229, 227, 227, 106, 201, 231, 191, 229, 111, 112, 113, 218, 115, 116, 117, 63, 227, 120, 230, 222, 231, 223, 224, 541, 228, 222, 228, 228, 228, 221, 228, 228, 228, 218, 218, 228, 228, 191, 222, 229, 228, 228, 228, 146, 228, 227, 227, 13, 1, 221, 231, 154, 155, 156, 157, 158, 159, 210, 229, 229, 213, 222, 15, 16, 218, 228, 19, 228, 34, 218, 118, 227, 1, 222, 228, 231, 227, 43, 126, 127, 218, 227, 1, 230, 187, 230, 228, 9, 10, 11, 228, 609, 174, 175, 210, 613, 25, 213, 616, 147, 230, 230, 620, 32, 70, 1070, 1071, 1072, 211, 212, 63, 214, 215, 216, 170, 230, 1, 220, 3, 230, 5, 230, 225, 230, 230, 228, 40, 123, 81, 82, 83, 84, 17, 99, 100, 88, 230, 56, 230, 92, 230, 107, 61, 1, 63, 98, 230, 230, 33, 108, 230, 230, 230, 67, 230, 69, 109, 110, 230, 17, 230, 230, 230, 230, 108, 230, 132, 230, 121, 98, 230, 56, 230, 58, 222, 33, 230, 230, 63, 230, 228, 230, 148, 230, 230, 230, 108, 230, 73, 230, 143, 135, 136, 137, 138, 139, 140, 141, 1, 230, 114, 230, 230, 122, 1, 63, 230, 230, 230, 6, 7, 230, 230, 98, 230, 12, 230, 131, 230, 230, 230, 230, 25, 20, 21, 230, 230, 230, 230, 182, 27, 230, 230, 30, 31, 230, 230, 122, 230, 36, 230, 230, 230, 209, 41, 42, 230, 44, 45, 46, 230, 48, 166, 167, 57, 230, 230, 142, 55, 230, 118, 64, 59, 60, 123, 230, 151, 230, 126, 127, 230, 68, 230, 230, 230, 228, 230, 123, 230, 230, 77, 230, 230, 86, 230, 230, 227, 90, 85, 147, 87, 230, 89, 1, 91, 98, 93, 94, 101, 102, 809, 810, 811, 812, 813, 814, 815, 230, 222, 106, 230, 196, 226, 230, 111, 112, 113, 4, 115, 116, 117, 29, 230, 120, 230, 230, 230, 230, 230, 37, 133, 18, 230, 108, 210, 108, 1, 108, 223, 26, 108, 49, 50, 228, 52, 53, 54, 150, 108, 146, 153, 108, 17, 40, 210, 210, 227, 154, 155, 156, 157, 158, 159, 227, 222, 230, 74, 1, 33, 3, 230, 5, 123, 230, 227, 178, 230, 1209, 230, 230, 67, 230, 69, 17, 108, 230, 230, 230, 230, 230, 187, 230, 230, 196, 197, 198, 230, 230, 63, 33, 230, 230, 230, 230, 230, 230, 230, 230, 95, 230, 230, 230, 230, 230, 211, 212, 230, 214, 215, 216, 223, 224, 56, 220, 58, 227, 230, 210, 225, 63, 230, 210, 210, 98, 108, 123, 210, 108, 210, 73, 108, 128, 108, 130, 210, 210, 210, 108, 108, 108, 108, 108, 108, 118, 210, 210, 210, 210, 210, 123, 230, 230, 149, 210, 98, 210, 210, 210, 210, 134, 210, 210, 210, 123, 123, 123, 210, 227, 227, 123, 167, 123, 230, 108, 230, 172, 151, 152, 122, 176, 69, 227, 108, 230, 181, 230, 1, 184, 49, 230, 230, 230, 189, 230, 230, 0, 1, 230, 142, 4, 15, 16, 230, 230, 19, 227, 203, 151, 227, 14, 230, 208, 17, 18, 230, 227, 230, 230, 210, 24, 230, 230, 219, 230, 230, 230, 201, 230, 227, 226, 35, 49, 123, 38, 39, 230, 230, 230, 210, 227, 123, 123, 131, 123, 123, 210, 210, 222, 63, 210, 123, 108, 196, 210, 123, 123, 123, 62, 123, 210, 108, 108, 67, 108, 227, 227, 81, 82, 83, 84, 75, 160, 108, 88, 49, 230, 229, 92, 167, 223, 227, 227, 227, 98, 227, 108, 108, 176, 230, 230, 227, 96, 97, 227, 109, 110, 227, 227, 227, 227, 161, 162, 163, 227, 165, 166, 121, 168, 169, 114, 171, 227, 173, 227, 203, 176, 205, 206, 179, 180, 181, 227, 183, 227, 227, 227, 131, 188, 143, 227, 219, 192, 193, 194, 230, 69, 123, 226, 108, 144, 145, 202, 108, 161, 162, 163, 207, 165, 166, 108, 168, 169, 227, 171, 123, 173, 123, 210, 176, 164, 123, 179, 180, 181, 230, 183, 123, 182, 123, 123, 188, 108, 177, 123, 192, 193, 194, 123, 123, 123, 123, 186, 123, 227, 202, 190, 161, 162, 163, 207, 165, 166, 227, 168, 169, 227, 171, 131, 173, 123, 123, 176, 227, 1, 179, 180, 181, 227, 183, 123, 227, 227, 123, 188, 227, 227, 227, 192, 193, 194, 227, 227, 230, 227, 22, 23, 160, 202, 227, 227, 28, 227, 207, 167, 227, 227, 227, 227, 227, 227, 108, 227, 176, 227, 227, 227, 227, 227, 227, 227, 227, 227, 210, 227, 227, 227, 227, 123, 123, 227, 123, 123, 227, 227, 123, 227, 227, 65, 66, 203, 123, 205, 206, 71, 72, 227, 227, 123, 227, 227, 78, 79, 80, 230, 108, 219, 123, 227, 227, 227, 123, 227, 226, 123, 227, 227, 227, 227, 227, 227, 227, 227, 227, 210, 123, 227, 104, 105, 123, 230, 123, 123, 210, 230, 123, 227, 123, 123, 123, 227, 123, 227, 227, 227, 227, 227, 227, 227, 227, 123, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 123, 227, 227, 230, 227, 227, 230, 227, 227, 227, 227, 227, 227, 227, 108, 227, 123, 129, 227, 129, 129, 227, 227, 74, 227, 227, 227, 227, 227, 1023, 227, 227, 227, 227, 227, 227, 1025, 227, 227, 227, 227, 227, 227, 227, 227, 266, 227, 227, 227, 1285, 227, 227, 498, 227, 227, 227, 227, 227, 217, 227, 227, 227, 227, 1036, 1249, 227, 227, 1247, 231, 513, 1228, 227, 227, 336, 227, 1239, 485, 462, 227, 529, 227, 227, 227, 227, 1237, 227, 227, 227, 583, 227, 227, 1251, 1258, 227, 230, 230, 227, 227, 222, 232, 232, 227, 230, 232, 1132, 227, 227, 227, 369, 567, 1233, 475, 111, 165, 1102, 92, -1, 1100, 398, 238, -1, -1, -1, 388, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, -1, -1, -1, -1, -1, -1, -1, 295 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 234, 0, 1, 4, 14, 17, 18, 24, 35, 38, 39, 62, 67, 75, 96, 97, 114, 131, 144, 145, 164, 177, 186, 190, 235, 240, 245, 269, 275, 281, 295, 315, 338, 352, 367, 374, 378, 388, 397, 418, 424, 430, 434, 440, 498, 513, 227, 228, 229, 229, 316, 398, 425, 229, 435, 229, 353, 419, 339, 229, 276, 296, 368, 229, 229, 389, 229, 229, 379, 1, 25, 32, 98, 270, 271, 272, 273, 274, 1, 22, 23, 28, 65, 66, 71, 72, 78, 79, 80, 104, 105, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 229, 229, 229, 1, 61, 431, 432, 433, 229, 1, 6, 7, 12, 20, 21, 27, 30, 31, 36, 41, 42, 44, 45, 46, 48, 55, 59, 60, 68, 77, 85, 87, 89, 91, 93, 94, 106, 111, 112, 113, 115, 116, 117, 120, 146, 154, 155, 156, 157, 158, 159, 187, 211, 212, 214, 215, 216, 220, 225, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 491, 495, 496, 497, 229, 229, 229, 1, 95, 119, 241, 242, 243, 244, 229, 229, 229, 1, 29, 37, 49, 50, 52, 53, 54, 74, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 1, 25, 57, 64, 86, 90, 98, 101, 102, 133, 150, 153, 178, 196, 197, 198, 223, 224, 246, 247, 248, 249, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 229, 1, 221, 282, 283, 284, 285, 286, 1, 98, 375, 376, 377, 229, 227, 230, 230, 230, 228, 271, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 228, 500, 1, 15, 16, 19, 63, 81, 82, 83, 84, 88, 92, 98, 109, 110, 121, 143, 182, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 1, 3, 5, 17, 33, 56, 58, 63, 73, 98, 122, 142, 151, 196, 223, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 413, 414, 415, 416, 417, 1, 61, 125, 426, 427, 428, 429, 230, 228, 432, 1, 98, 125, 436, 437, 438, 439, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 492, 230, 488, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 228, 442, 1, 17, 33, 63, 118, 126, 127, 147, 222, 354, 355, 356, 357, 358, 359, 360, 364, 365, 366, 1, 125, 222, 420, 421, 422, 423, 1, 56, 61, 63, 122, 340, 344, 345, 346, 350, 351, 227, 230, 230, 228, 242, 1, 76, 170, 277, 278, 279, 280, 1, 17, 33, 63, 98, 118, 134, 151, 152, 201, 222, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 311, 1, 35, 76, 125, 369, 370, 371, 372, 373, 230, 230, 230, 230, 230, 230, 230, 230, 228, 515, 227, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 228, 247, 1, 98, 218, 390, 391, 392, 393, 227, 230, 228, 283, 170, 230, 228, 376, 1, 98, 218, 222, 380, 381, 382, 383, 384, 123, 123, 123, 227, 108, 108, 210, 108, 108, 237, 237, 237, 108, 108, 108, 210, 210, 227, 227, 230, 230, 230, 335, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 228, 318, 227, 230, 230, 230, 230, 230, 230, 410, 230, 230, 230, 230, 230, 230, 230, 228, 400, 230, 230, 228, 427, 123, 227, 230, 230, 228, 437, 210, 237, 237, 210, 108, 210, 108, 123, 210, 237, 210, 108, 108, 237, 108, 210, 210, 210, 237, 108, 108, 237, 108, 108, 108, 108, 210, 230, 210, 230, 210, 237, 237, 210, 210, 210, 210, 213, 210, 213, 210, 210, 210, 123, 237, 210, 210, 237, 237, 210, 210, 227, 227, 230, 230, 361, 230, 230, 230, 230, 230, 228, 355, 230, 230, 228, 421, 227, 230, 230, 341, 230, 228, 345, 123, 123, 227, 227, 230, 230, 228, 278, 227, 230, 230, 312, 230, 230, 230, 230, 230, 308, 230, 228, 298, 227, 230, 230, 230, 228, 370, 210, 210, 210, 123, 210, 210, 210, 237, 227, 123, 210, 123, 108, 108, 123, 123, 123, 123, 123, 123, 108, 123, 199, 200, 250, 251, 199, 200, 252, 253, 123, 123, 227, 227, 230, 394, 228, 391, 210, 227, 229, 123, 227, 227, 230, 385, 230, 228, 381, 227, 227, 227, 227, 227, 227, 227, 135, 136, 137, 138, 139, 140, 141, 236, 237, 227, 227, 227, 227, 227, 227, 227, 227, 108, 108, 237, 230, 108, 108, 237, 108, 108, 237, 123, 108, 108, 237, 108, 239, 239, 227, 123, 174, 175, 123, 210, 123, 123, 230, 123, 123, 108, 123, 123, 123, 123, 227, 123, 123, 227, 227, 123, 123, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 49, 161, 162, 163, 165, 166, 168, 169, 171, 173, 176, 179, 180, 181, 183, 188, 192, 193, 194, 202, 207, 493, 494, 227, 49, 161, 162, 163, 165, 166, 168, 169, 171, 173, 176, 179, 180, 181, 183, 188, 192, 193, 194, 202, 207, 489, 490, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 123, 210, 230, 123, 108, 123, 123, 123, 227, 123, 123, 227, 123, 123, 230, 108, 348, 349, 227, 227, 227, 123, 123, 227, 123, 210, 230, 123, 123, 123, 123, 210, 230, 123, 227, 123, 123, 123, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 231, 227, 231, 227, 227, 123, 230, 227, 227, 1, 98, 191, 218, 287, 288, 289, 290, 291, 227, 123, 230, 123, 227, 236, 236, 236, 236, 236, 236, 236, 227, 227, 227, 51, 124, 336, 337, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 9, 10, 11, 238, 239, 227, 227, 227, 227, 227, 227, 227, 227, 227, 8, 195, 411, 412, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 231, 227, 231, 227, 227, 13, 34, 43, 70, 99, 100, 107, 132, 148, 209, 362, 363, 227, 227, 227, 227, 227, 227, 227, 227, 227, 49, 185, 195, 342, 343, 217, 231, 347, 227, 227, 227, 227, 4, 18, 26, 40, 67, 69, 95, 128, 130, 149, 167, 172, 176, 181, 184, 189, 203, 208, 219, 226, 313, 314, 227, 227, 227, 227, 227, 49, 161, 162, 163, 165, 166, 168, 169, 171, 173, 176, 179, 180, 181, 183, 188, 192, 193, 194, 202, 207, 309, 310, 227, 227, 227, 227, 251, 253, 227, 69, 131, 160, 167, 176, 203, 205, 206, 219, 226, 395, 396, 227, 230, 230, 292, 228, 288, 227, 69, 131, 160, 167, 176, 203, 205, 206, 219, 226, 386, 387, 227, 227, 231, 238, 238, 238, 227, 231, 494, 490, 227, 231, 227, 231, 108, 349, 227, 232, 232, 232, 227, 231, 227, 231, 227, 231, 123, 204, 239, 230, 227, 227, 231, 337, 412, 363, 343, 129, 129, 129, 314, 310, 396, 227, 227, 227, 40, 67, 69, 114, 131, 166, 167, 222, 226, 293, 294, 387, 227, 231, 294 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 233, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 239, 239, 239, 239, 240, 241, 241, 242, 242, 242, 243, 244, 245, 246, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 270, 271, 271, 271, 271, 272, 273, 274, 276, 275, 277, 277, 278, 278, 278, 279, 280, 281, 282, 282, 283, 283, 283, 284, 286, 285, 287, 287, 288, 288, 288, 288, 289, 290, 290, 292, 291, 293, 293, 294, 294, 294, 294, 294, 294, 294, 294, 294, 296, 295, 297, 297, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, 299, 300, 301, 302, 303, 304, 305, 306, 308, 307, 309, 309, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 310, 312, 311, 313, 313, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 316, 315, 317, 317, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 335, 334, 336, 336, 337, 337, 339, 338, 341, 340, 342, 342, 343, 343, 343, 344, 344, 345, 345, 345, 345, 345, 347, 346, 348, 348, 349, 349, 350, 351, 353, 352, 354, 354, 355, 355, 355, 355, 355, 355, 355, 355, 355, 356, 357, 358, 359, 361, 360, 362, 362, 363, 363, 363, 363, 363, 363, 363, 363, 363, 363, 364, 365, 366, 368, 367, 369, 369, 370, 370, 370, 370, 371, 372, 373, 374, 375, 375, 376, 376, 377, 379, 378, 380, 380, 381, 381, 381, 381, 382, 383, 385, 384, 386, 386, 387, 387, 387, 387, 387, 387, 387, 387, 387, 387, 389, 388, 390, 390, 391, 391, 391, 392, 394, 393, 395, 395, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 398, 397, 399, 399, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 401, 402, 403, 404, 405, 406, 407, 408, 408, 410, 409, 411, 411, 412, 412, 413, 414, 415, 416, 417, 419, 418, 420, 420, 421, 421, 421, 422, 423, 425, 424, 426, 426, 427, 427, 427, 428, 429, 430, 431, 431, 432, 432, 433, 435, 434, 436, 436, 437, 437, 437, 438, 439, 440, 441, 441, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 469, 470, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 488, 487, 489, 489, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 492, 491, 493, 493, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 495, 496, 497, 498, 499, 499, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 514, 515, 515, 515, 515, 515, 515, 515, 515, 515, 516, 517, 518, 519, 520, 521, 522, 523 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 0, 1, 2, 3, 3, 3, 5, 2, 1, 1, 1, 2, 4, 4, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 3, 1, 1, 1, 3, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 2, 1, 1, 1, 1, 2, 4, 4, 4, 0, 6, 2, 1, 1, 1, 2, 4, 4, 5, 2, 1, 1, 1, 2, 4, 0, 6, 2, 1, 1, 1, 1, 2, 4, 4, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 3, 1, 1, 1, 0, 6, 0, 5, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 0, 5, 3, 1, 1, 3, 4, 4, 0, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 0, 6, 2, 1, 1, 1, 1, 2, 4, 4, 4, 5, 2, 1, 1, 1, 4, 0, 6, 2, 1, 1, 1, 1, 2, 4, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, 1, 1, 1, 2, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 3, 1, 1, 1, 4, 4, 4, 4, 4, 0, 6, 2, 1, 1, 1, 1, 4, 4, 0, 6, 2, 1, 1, 1, 1, 4, 4, 5, 2, 1, 1, 1, 4, 0, 6, 2, 1, 1, 1, 1, 4, 4, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 27: #line 400 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = 0; } #line 2827 "conf_parser.c" /* yacc.c:1646 */ break; case 29: #line 402 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-1].number) + (yyvsp[0].number); } #line 2835 "conf_parser.c" /* yacc.c:1646 */ break; case 30: #line 406 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) + (yyvsp[0].number); } #line 2843 "conf_parser.c" /* yacc.c:1646 */ break; case 31: #line 410 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 + (yyvsp[0].number); } #line 2851 "conf_parser.c" /* yacc.c:1646 */ break; case 32: #line 414 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 * 60 + (yyvsp[0].number); } #line 2859 "conf_parser.c" /* yacc.c:1646 */ break; case 33: #line 418 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 + (yyvsp[0].number); } #line 2867 "conf_parser.c" /* yacc.c:1646 */ break; case 34: #line 422 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 7 + (yyvsp[0].number); } #line 2875 "conf_parser.c" /* yacc.c:1646 */ break; case 35: #line 426 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 7 * 4 + (yyvsp[0].number); } #line 2883 "conf_parser.c" /* yacc.c:1646 */ break; case 36: #line 430 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 60 * 60 * 24 * 365 + (yyvsp[0].number); } #line 2891 "conf_parser.c" /* yacc.c:1646 */ break; case 37: #line 435 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = 0; } #line 2897 "conf_parser.c" /* yacc.c:1646 */ break; case 39: #line 436 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-1].number) + (yyvsp[0].number); } #line 2903 "conf_parser.c" /* yacc.c:1646 */ break; case 40: #line 437 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) + (yyvsp[0].number); } #line 2909 "conf_parser.c" /* yacc.c:1646 */ break; case 41: #line 438 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 1024 + (yyvsp[0].number); } #line 2915 "conf_parser.c" /* yacc.c:1646 */ break; case 42: #line 439 "conf_parser.y" /* yacc.c:1646 */ { (yyval.number) = (yyvsp[-2].number) * 1024 * 1024 + (yyvsp[0].number); } #line 2921 "conf_parser.c" /* yacc.c:1646 */ break; case 49: #line 453 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) add_conf_module(libio_basename(yylval.string)); } #line 2930 "conf_parser.c" /* yacc.c:1646 */ break; case 50: #line 459 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) mod_add_path(yylval.string); } #line 2939 "conf_parser.c" /* yacc.c:1646 */ break; case 76: #line 485 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3); #endif } #line 2950 "conf_parser.c" /* yacc.c:1646 */ break; case 77: #line 491 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1); #endif } #line 2961 "conf_parser.c" /* yacc.c:1646 */ break; case 80: #line 500 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3); #endif } #line 2972 "conf_parser.c" /* yacc.c:1646 */ break; case 81: #line 506 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); #endif } #line 2983 "conf_parser.c" /* yacc.c:1646 */ break; case 82: #line 514 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) { if (!ServerInfo.rsa_private_key_file) { conf_error_report("No rsa_private_key_file specified, SSL disabled"); break; } if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string, SSL_FILETYPE_PEM) <= 0 || SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string, SSL_FILETYPE_PEM) <= 0) { report_crypto_errors(); conf_error_report("Could not open/read certificate file"); break; } if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0 || SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0) { report_crypto_errors(); conf_error_report("Could not read RSA private key"); break; } if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) || !SSL_CTX_check_private_key(ServerInfo.client_ctx)) { report_crypto_errors(); conf_error_report("Could not read RSA private key"); break; } } #endif } #line 3028 "conf_parser.c" /* yacc.c:1646 */ break; case 83: #line 556 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO BIO *file = NULL; if (conf_parser_ctx.pass != 1) break; if (ServerInfo.rsa_private_key) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; } if (ServerInfo.rsa_private_key_file) { MyFree(ServerInfo.rsa_private_key_file); ServerInfo.rsa_private_key_file = NULL; } ServerInfo.rsa_private_key_file = xstrdup(yylval.string); if ((file = BIO_new_file(yylval.string, "r")) == NULL) { conf_error_report("File open failed, ignoring"); break; } ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); BIO_set_close(file, BIO_CLOSE); BIO_free(file); if (ServerInfo.rsa_private_key == NULL) { conf_error_report("Couldn't extract key, ignoring"); break; } if (!RSA_check_key(ServerInfo.rsa_private_key)) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; conf_error_report("Invalid key, ignoring"); break; } /* require 2048 bit (256 byte) key */ if (RSA_size(ServerInfo.rsa_private_key) != 256) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; conf_error_report("Not a 2048 bit key, ignoring"); } #endif } #line 3090 "conf_parser.c" /* yacc.c:1646 */ break; case 84: #line 615 "conf_parser.y" /* yacc.c:1646 */ { /* TBD - XXX: error reporting */ #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) { BIO *file = BIO_new_file(yylval.string, "r"); if (file) { DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL); BIO_free(file); if (dh) { if (DH_size(dh) < 128) conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size"); else SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh); DH_free(dh); } } } #endif } #line 3121 "conf_parser.c" /* yacc.c:1646 */ break; case 85: #line 643 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string); #endif } #line 3132 "conf_parser.c" /* yacc.c:1646 */ break; case 86: #line 651 "conf_parser.y" /* yacc.c:1646 */ { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.name) { if (valid_servname(yylval.string)) ServerInfo.name = xstrdup(yylval.string); else { conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting."); exit(0); } } } #line 3150 "conf_parser.c" /* yacc.c:1646 */ break; case 87: #line 666 "conf_parser.y" /* yacc.c:1646 */ { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) { if (valid_sid(yylval.string)) ServerInfo.sid = xstrdup(yylval.string); else { conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting."); exit(0); } } } #line 3168 "conf_parser.c" /* yacc.c:1646 */ break; case 88: #line 681 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { MyFree(ServerInfo.description); ServerInfo.description = xstrdup(yylval.string); } } #line 3180 "conf_parser.c" /* yacc.c:1646 */ break; case 89: #line 690 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { char *p; if ((p = strchr(yylval.string, ' ')) != NULL) p = '\0'; MyFree(ServerInfo.network_name); ServerInfo.network_name = xstrdup(yylval.string); } } #line 3197 "conf_parser.c" /* yacc.c:1646 */ break; case 90: #line 704 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; MyFree(ServerInfo.network_desc); ServerInfo.network_desc = xstrdup(yylval.string); } #line 3209 "conf_parser.c" /* yacc.c:1646 */ break; case 91: #line 713 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2 && *yylval.string != '*') { struct addrinfo hints, *res; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(yylval.string, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string); else { assert(res != NULL); memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen); ServerInfo.ip.ss.ss_family = res->ai_family; ServerInfo.ip.ss_len = res->ai_addrlen; freeaddrinfo(res); ServerInfo.specific_ipv4_vhost = 1; } } } #line 3240 "conf_parser.c" /* yacc.c:1646 */ break; case 92: #line 741 "conf_parser.y" /* yacc.c:1646 */ { #ifdef IPV6 if (conf_parser_ctx.pass == 2 && *yylval.string != '*') { struct addrinfo hints, *res; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(yylval.string, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string); else { assert(res != NULL); memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen); ServerInfo.ip6.ss.ss_family = res->ai_family; ServerInfo.ip6.ss_len = res->ai_addrlen; freeaddrinfo(res); ServerInfo.specific_ipv6_vhost = 1; } } #endif } #line 3273 "conf_parser.c" /* yacc.c:1646 */ break; case 93: #line 771 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if ((yyvsp[-1].number) < MAXCLIENTS_MIN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); conf_error_report(buf); ServerInfo.max_clients = MAXCLIENTS_MIN; } else if ((yyvsp[-1].number) > MAXCLIENTS_MAX) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); conf_error_report(buf); ServerInfo.max_clients = MAXCLIENTS_MAX; } else ServerInfo.max_clients = (yyvsp[-1].number); } #line 3301 "conf_parser.c" /* yacc.c:1646 */ break; case 94: #line 796 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if ((yyvsp[-1].number) < 9) { conf_error_report("max_nick_length too low, setting to 9"); ServerInfo.max_nick_length = 9; } else if ((yyvsp[-1].number) > NICKLEN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN); conf_error_report(buf); ServerInfo.max_nick_length = NICKLEN; } else ServerInfo.max_nick_length = (yyvsp[-1].number); } #line 3326 "conf_parser.c" /* yacc.c:1646 */ break; case 95: #line 818 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if ((yyvsp[-1].number) < 80) { conf_error_report("max_topic_length too low, setting to 80"); ServerInfo.max_topic_length = 80; } else if ((yyvsp[-1].number) > TOPICLEN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN); conf_error_report(buf); ServerInfo.max_topic_length = TOPICLEN; } else ServerInfo.max_topic_length = (yyvsp[-1].number); } #line 3351 "conf_parser.c" /* yacc.c:1646 */ break; case 96: #line 840 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ServerInfo.hub = yylval.number; } #line 3360 "conf_parser.c" /* yacc.c:1646 */ break; case 104: #line 855 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.name); AdminInfo.name = xstrdup(yylval.string); } #line 3372 "conf_parser.c" /* yacc.c:1646 */ break; case 105: #line 864 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.email); AdminInfo.email = xstrdup(yylval.string); } #line 3384 "conf_parser.c" /* yacc.c:1646 */ break; case 106: #line 873 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.description); AdminInfo.description = xstrdup(yylval.string); } #line 3396 "conf_parser.c" /* yacc.c:1646 */ break; case 107: #line 885 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 3405 "conf_parser.c" /* yacc.c:1646 */ break; case 108: #line 889 "conf_parser.y" /* yacc.c:1646 */ { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.file.buf[0]) break; DLINK_FOREACH(ptr, block_state.mask.list.head) motd_add(ptr->data, block_state.file.buf); } #line 3422 "conf_parser.c" /* yacc.c:1646 */ break; case 114: #line 906 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); } #line 3431 "conf_parser.c" /* yacc.c:1646 */ break; case 115: #line 912 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); } #line 3440 "conf_parser.c" /* yacc.c:1646 */ break; case 122: #line 927 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigLoggingEntry.use_logging = yylval.number; } #line 3449 "conf_parser.c" /* yacc.c:1646 */ break; case 123: #line 933 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 3458 "conf_parser.c" /* yacc.c:1646 */ break; case 124: #line 937 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if (block_state.type.value && block_state.file.buf[0]) log_set_file(block_state.type.value, block_state.size.value, block_state.file.buf); } #line 3471 "conf_parser.c" /* yacc.c:1646 */ break; case 131: #line 953 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); } #line 3482 "conf_parser.c" /* yacc.c:1646 */ break; case 132: #line 961 "conf_parser.y" /* yacc.c:1646 */ { block_state.size.value = (yyvsp[-1].number); } #line 3490 "conf_parser.c" /* yacc.c:1646 */ break; case 133: #line 964 "conf_parser.y" /* yacc.c:1646 */ { block_state.size.value = 0; } #line 3498 "conf_parser.c" /* yacc.c:1646 */ break; case 134: #line 969 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = 0; } #line 3507 "conf_parser.c" /* yacc.c:1646 */ break; case 138: #line 976 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_USER; } #line 3516 "conf_parser.c" /* yacc.c:1646 */ break; case 139: #line 980 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_OPER; } #line 3525 "conf_parser.c" /* yacc.c:1646 */ break; case 140: #line 984 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_GLINE; } #line 3534 "conf_parser.c" /* yacc.c:1646 */ break; case 141: #line 988 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_XLINE; } #line 3543 "conf_parser.c" /* yacc.c:1646 */ break; case 142: #line 992 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_RESV; } #line 3552 "conf_parser.c" /* yacc.c:1646 */ break; case 143: #line 996 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_DLINE; } #line 3561 "conf_parser.c" /* yacc.c:1646 */ break; case 144: #line 1000 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_KLINE; } #line 3570 "conf_parser.c" /* yacc.c:1646 */ break; case 145: #line 1004 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_KILL; } #line 3579 "conf_parser.c" /* yacc.c:1646 */ break; case 146: #line 1008 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_DEBUG; } #line 3588 "conf_parser.c" /* yacc.c:1646 */ break; case 147: #line 1018 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; reset_block_state(); block_state.flags.value |= CONF_FLAGS_ENCRYPTED; } #line 3600 "conf_parser.c" /* yacc.c:1646 */ break; case 148: #line 1025 "conf_parser.y" /* yacc.c:1646 */ { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0]) break; #ifdef HAVE_LIBCRYPTO if (!block_state.file.buf[0] && !block_state.rpass.buf[0]) break; #else if (!block_state.rpass.buf[0]) break; #endif DLINK_FOREACH(ptr, block_state.mask.list.head) { struct MaskItem *conf = NULL; struct split_nuh_item nuh; nuh.nuhmask = ptr->data; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); conf = conf_make(CONF_OPER); conf->name = xstrdup(block_state.name.buf); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.cert.buf[0]) conf->certfp = xstrdup(block_state.cert.buf); if (block_state.rpass.buf[0]) conf->passwd = xstrdup(block_state.rpass.buf); conf->flags = block_state.flags.value; conf->modes = block_state.modes.value; conf->port = block_state.port.value; conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits); conf_add_class_to_conf(conf, block_state.class.buf); #ifdef HAVE_LIBCRYPTO if (block_state.file.buf[0]) { BIO *file = NULL; RSA *pkey = NULL; if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL) { conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist"); break; } if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL) conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax."); conf->rsa_public_key = pkey; BIO_set_close(file, BIO_CLOSE); BIO_free(file); } #endif /* HAVE_LIBCRYPTO */ } } #line 3676 "conf_parser.c" /* yacc.c:1646 */ break; case 162: #line 1105 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 3685 "conf_parser.c" /* yacc.c:1646 */ break; case 163: #line 1111 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); } #line 3694 "conf_parser.c" /* yacc.c:1646 */ break; case 164: #line 1117 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 3703 "conf_parser.c" /* yacc.c:1646 */ break; case 165: #line 1123 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; } #line 3717 "conf_parser.c" /* yacc.c:1646 */ break; case 166: #line 1134 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); } #line 3726 "conf_parser.c" /* yacc.c:1646 */ break; case 167: #line 1140 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); } #line 3735 "conf_parser.c" /* yacc.c:1646 */ break; case 168: #line 1146 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if (yylval.number) block_state.flags.value |= CONF_FLAGS_SSL; else block_state.flags.value &= ~CONF_FLAGS_SSL; } #line 3749 "conf_parser.c" /* yacc.c:1646 */ break; case 169: #line 1157 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); } #line 3758 "conf_parser.c" /* yacc.c:1646 */ break; case 170: #line 1163 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value = 0; } #line 3767 "conf_parser.c" /* yacc.c:1646 */ break; case 174: #line 1170 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_BOTS; } #line 3776 "conf_parser.c" /* yacc.c:1646 */ break; case 175: #line 1174 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_CCONN; } #line 3785 "conf_parser.c" /* yacc.c:1646 */ break; case 176: #line 1178 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_DEAF; } #line 3794 "conf_parser.c" /* yacc.c:1646 */ break; case 177: #line 1182 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_DEBUG; } #line 3803 "conf_parser.c" /* yacc.c:1646 */ break; case 178: #line 1186 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_FULL; } #line 3812 "conf_parser.c" /* yacc.c:1646 */ break; case 179: #line 1190 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_HIDDEN; } #line 3821 "conf_parser.c" /* yacc.c:1646 */ break; case 180: #line 1194 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SKILL; } #line 3830 "conf_parser.c" /* yacc.c:1646 */ break; case 181: #line 1198 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_NCHANGE; } #line 3839 "conf_parser.c" /* yacc.c:1646 */ break; case 182: #line 1202 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_REJ; } #line 3848 "conf_parser.c" /* yacc.c:1646 */ break; case 183: #line 1206 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_UNAUTH; } #line 3857 "conf_parser.c" /* yacc.c:1646 */ break; case 184: #line 1210 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SPY; } #line 3866 "conf_parser.c" /* yacc.c:1646 */ break; case 185: #line 1214 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_EXTERNAL; } #line 3875 "conf_parser.c" /* yacc.c:1646 */ break; case 186: #line 1218 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_OPERWALL; } #line 3884 "conf_parser.c" /* yacc.c:1646 */ break; case 187: #line 1222 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SERVNOTICE; } #line 3893 "conf_parser.c" /* yacc.c:1646 */ break; case 188: #line 1226 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_INVISIBLE; } #line 3902 "conf_parser.c" /* yacc.c:1646 */ break; case 189: #line 1230 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_WALLOP; } #line 3911 "conf_parser.c" /* yacc.c:1646 */ break; case 190: #line 1234 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SOFTCALLERID; } #line 3920 "conf_parser.c" /* yacc.c:1646 */ break; case 191: #line 1238 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_CALLERID; } #line 3929 "conf_parser.c" /* yacc.c:1646 */ break; case 192: #line 1242 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_LOCOPS; } #line 3938 "conf_parser.c" /* yacc.c:1646 */ break; case 193: #line 1246 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_REGONLY; } #line 3947 "conf_parser.c" /* yacc.c:1646 */ break; case 194: #line 1250 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_FARCONNECT; } #line 3956 "conf_parser.c" /* yacc.c:1646 */ break; case 195: #line 1256 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value = 0; } #line 3965 "conf_parser.c" /* yacc.c:1646 */ break; case 199: #line 1263 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_KILL_REMOTE; } #line 3974 "conf_parser.c" /* yacc.c:1646 */ break; case 200: #line 1267 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_KILL; } #line 3983 "conf_parser.c" /* yacc.c:1646 */ break; case 201: #line 1271 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_CONNECT_REMOTE; } #line 3992 "conf_parser.c" /* yacc.c:1646 */ break; case 202: #line 1275 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_CONNECT; } #line 4001 "conf_parser.c" /* yacc.c:1646 */ break; case 203: #line 1279 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SQUIT_REMOTE; } #line 4010 "conf_parser.c" /* yacc.c:1646 */ break; case 204: #line 1283 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SQUIT; } #line 4019 "conf_parser.c" /* yacc.c:1646 */ break; case 205: #line 1287 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_K; } #line 4028 "conf_parser.c" /* yacc.c:1646 */ break; case 206: #line 1291 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_UNKLINE; } #line 4037 "conf_parser.c" /* yacc.c:1646 */ break; case 207: #line 1295 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_DLINE; } #line 4046 "conf_parser.c" /* yacc.c:1646 */ break; case 208: #line 1299 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_UNDLINE; } #line 4055 "conf_parser.c" /* yacc.c:1646 */ break; case 209: #line 1303 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_X; } #line 4064 "conf_parser.c" /* yacc.c:1646 */ break; case 210: #line 1307 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_GLINE; } #line 4073 "conf_parser.c" /* yacc.c:1646 */ break; case 211: #line 1311 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_DIE; } #line 4082 "conf_parser.c" /* yacc.c:1646 */ break; case 212: #line 1315 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_RESTART; } #line 4091 "conf_parser.c" /* yacc.c:1646 */ break; case 213: #line 1319 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_REHASH; } #line 4100 "conf_parser.c" /* yacc.c:1646 */ break; case 214: #line 1323 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_ADMIN; } #line 4109 "conf_parser.c" /* yacc.c:1646 */ break; case 215: #line 1327 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_OPERWALL; } #line 4118 "conf_parser.c" /* yacc.c:1646 */ break; case 216: #line 1331 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_GLOBOPS; } #line 4127 "conf_parser.c" /* yacc.c:1646 */ break; case 217: #line 1335 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_WALLOPS; } #line 4136 "conf_parser.c" /* yacc.c:1646 */ break; case 218: #line 1339 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_LOCOPS; } #line 4145 "conf_parser.c" /* yacc.c:1646 */ break; case 219: #line 1343 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_REMOTEBAN; } #line 4154 "conf_parser.c" /* yacc.c:1646 */ break; case 220: #line 1347 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SET; } #line 4163 "conf_parser.c" /* yacc.c:1646 */ break; case 221: #line 1351 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_MODULE; } #line 4172 "conf_parser.c" /* yacc.c:1646 */ break; case 222: #line 1361 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 1) break; reset_block_state(); block_state.ping_freq.value = DEFAULT_PINGFREQUENCY; block_state.con_freq.value = DEFAULT_CONNECTFREQUENCY; block_state.max_total.value = MAXIMUM_LINKS_DEFAULT; block_state.max_sendq.value = DEFAULT_SENDQ; block_state.max_recvq.value = DEFAULT_RECVQ; } #line 4189 "conf_parser.c" /* yacc.c:1646 */ break; case 223: #line 1373 "conf_parser.y" /* yacc.c:1646 */ { struct ClassItem *class = NULL; if (conf_parser_ctx.pass != 1) break; if (!block_state.class.buf[0]) break; if (!(class = class_find(block_state.class.buf, 0))) class = class_make(); class->active = 1; MyFree(class->name); class->name = xstrdup(block_state.class.buf); class->ping_freq = block_state.ping_freq.value; class->max_perip = block_state.max_perip.value; class->con_freq = block_state.con_freq.value; class->max_total = block_state.max_total.value; class->max_global = block_state.max_global.value; class->max_local = block_state.max_local.value; class->max_ident = block_state.max_ident.value; class->max_sendq = block_state.max_sendq.value; class->max_recvq = block_state.max_recvq.value; if (block_state.min_idle.value > block_state.max_idle.value) { block_state.min_idle.value = 0; block_state.max_idle.value = 0; block_state.flags.value &= ~CLASS_FLAGS_FAKE_IDLE; } class->flags = block_state.flags.value; class->min_idle = block_state.min_idle.value; class->max_idle = block_state.max_idle.value; if (class->number_per_cidr && block_state.number_per_cidr.value) if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) || (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value)) if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) || (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value)) rebuild_cidr_list(class); class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value; class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value; class->number_per_cidr = block_state.number_per_cidr.value; } #line 4241 "conf_parser.c" /* yacc.c:1646 */ break; case 243: #line 1439 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); } #line 4250 "conf_parser.c" /* yacc.c:1646 */ break; case 244: #line 1445 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.ping_freq.value = (yyvsp[-1].number); } #line 4259 "conf_parser.c" /* yacc.c:1646 */ break; case 245: #line 1451 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_perip.value = (yyvsp[-1].number); } #line 4268 "conf_parser.c" /* yacc.c:1646 */ break; case 246: #line 1457 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.con_freq.value = (yyvsp[-1].number); } #line 4277 "conf_parser.c" /* yacc.c:1646 */ break; case 247: #line 1463 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_total.value = (yyvsp[-1].number); } #line 4286 "conf_parser.c" /* yacc.c:1646 */ break; case 248: #line 1469 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_global.value = (yyvsp[-1].number); } #line 4295 "conf_parser.c" /* yacc.c:1646 */ break; case 249: #line 1475 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_local.value = (yyvsp[-1].number); } #line 4304 "conf_parser.c" /* yacc.c:1646 */ break; case 250: #line 1481 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_ident.value = (yyvsp[-1].number); } #line 4313 "conf_parser.c" /* yacc.c:1646 */ break; case 251: #line 1487 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.max_sendq.value = (yyvsp[-1].number); } #line 4322 "conf_parser.c" /* yacc.c:1646 */ break; case 252: #line 1493 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) if ((yyvsp[-1].number) >= CLIENT_FLOOD_MIN && (yyvsp[-1].number) <= CLIENT_FLOOD_MAX) block_state.max_recvq.value = (yyvsp[-1].number); } #line 4332 "conf_parser.c" /* yacc.c:1646 */ break; case 253: #line 1500 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.cidr_bitlen_ipv4.value = (yyvsp[-1].number) > 32 ? 32 : (yyvsp[-1].number); } #line 4341 "conf_parser.c" /* yacc.c:1646 */ break; case 254: #line 1506 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.cidr_bitlen_ipv6.value = (yyvsp[-1].number) > 128 ? 128 : (yyvsp[-1].number); } #line 4350 "conf_parser.c" /* yacc.c:1646 */ break; case 255: #line 1512 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.number_per_cidr.value = (yyvsp[-1].number); } #line 4359 "conf_parser.c" /* yacc.c:1646 */ break; case 256: #line 1518 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 1) break; block_state.min_idle.value = (yyvsp[-1].number); block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; } #line 4371 "conf_parser.c" /* yacc.c:1646 */ break; case 257: #line 1527 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 1) break; block_state.max_idle.value = (yyvsp[-1].number); block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; } #line 4383 "conf_parser.c" /* yacc.c:1646 */ break; case 258: #line 1536 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE; } #line 4392 "conf_parser.c" /* yacc.c:1646 */ break; case 262: #line 1543 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE; } #line 4401 "conf_parser.c" /* yacc.c:1646 */ break; case 263: #line 1547 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 1) block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS; } #line 4410 "conf_parser.c" /* yacc.c:1646 */ break; case 264: #line 1557 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 4419 "conf_parser.c" /* yacc.c:1646 */ break; case 266: #line 1563 "conf_parser.y" /* yacc.c:1646 */ { block_state.flags.value = 0; } #line 4427 "conf_parser.c" /* yacc.c:1646 */ break; case 270: #line 1569 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_SSL; } #line 4436 "conf_parser.c" /* yacc.c:1646 */ break; case 271: #line 1573 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_HIDDEN; } #line 4445 "conf_parser.c" /* yacc.c:1646 */ break; case 272: #line 1577 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_SERVER; } #line 4454 "conf_parser.c" /* yacc.c:1646 */ break; case 280: #line 1585 "conf_parser.y" /* yacc.c:1646 */ { block_state.flags.value = 0; } #line 4460 "conf_parser.c" /* yacc.c:1646 */ break; case 284: #line 1590 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { if (block_state.flags.value & LISTENER_SSL) #ifdef HAVE_LIBCRYPTO if (!ServerInfo.server_ctx) #endif { conf_error_report("SSL not available - port closed"); break; } add_listener((yyvsp[0].number), block_state.addr.buf, block_state.flags.value); } } #line 4479 "conf_parser.c" /* yacc.c:1646 */ break; case 285: #line 1604 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { int i; if (block_state.flags.value & LISTENER_SSL) #ifdef HAVE_LIBCRYPTO if (!ServerInfo.server_ctx) #endif { conf_error_report("SSL not available - port closed"); break; } for (i = (yyvsp[-2].number); i <= (yyvsp[0].number); ++i) add_listener(i, block_state.addr.buf, block_state.flags.value); } } #line 4502 "conf_parser.c" /* yacc.c:1646 */ break; case 286: #line 1624 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); } #line 4511 "conf_parser.c" /* yacc.c:1646 */ break; case 287: #line 1630 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); } #line 4520 "conf_parser.c" /* yacc.c:1646 */ break; case 288: #line 1639 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 4529 "conf_parser.c" /* yacc.c:1646 */ break; case 289: #line 1643 "conf_parser.y" /* yacc.c:1646 */ { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; DLINK_FOREACH(ptr, block_state.mask.list.head) { struct MaskItem *conf = NULL; struct split_nuh_item nuh; nuh.nuhmask = ptr->data; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); conf = conf_make(CONF_CLIENT); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.rpass.buf[0]) conf->passwd = xstrdup(block_state.rpass.buf); if (block_state.name.buf[0]) conf->name = xstrdup(block_state.name.buf); conf->flags = block_state.flags.value; conf->port = block_state.port.value; conf_add_class_to_conf(conf, block_state.class.buf); add_conf_by_address(CONF_CLIENT, conf); } } #line 4570 "conf_parser.c" /* yacc.c:1646 */ break; case 301: #line 1686 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); } #line 4579 "conf_parser.c" /* yacc.c:1646 */ break; case 302: #line 1692 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 4588 "conf_parser.c" /* yacc.c:1646 */ break; case 303: #line 1698 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); } #line 4597 "conf_parser.c" /* yacc.c:1646 */ break; case 304: #line 1704 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; } } #line 4611 "conf_parser.c" /* yacc.c:1646 */ break; case 305: #line 1715 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP); } #line 4620 "conf_parser.c" /* yacc.c:1646 */ break; case 309: #line 1722 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_SPOOF_NOTICE; } #line 4629 "conf_parser.c" /* yacc.c:1646 */ break; case 310: #line 1726 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NOLIMIT; } #line 4638 "conf_parser.c" /* yacc.c:1646 */ break; case 311: #line 1730 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE; } #line 4647 "conf_parser.c" /* yacc.c:1646 */ break; case 312: #line 1734 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NEED_IDENTD; } #line 4656 "conf_parser.c" /* yacc.c:1646 */ break; case 313: #line 1738 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_CAN_FLOOD; } #line 4665 "conf_parser.c" /* yacc.c:1646 */ break; case 314: #line 1742 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NO_TILDE; } #line 4674 "conf_parser.c" /* yacc.c:1646 */ break; case 315: #line 1746 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE; } #line 4683 "conf_parser.c" /* yacc.c:1646 */ break; case 316: #line 1750 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTRESV; } #line 4692 "conf_parser.c" /* yacc.c:1646 */ break; case 317: #line 1754 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_WEBIRC; } #line 4701 "conf_parser.c" /* yacc.c:1646 */ break; case 318: #line 1758 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD; } #line 4710 "conf_parser.c" /* yacc.c:1646 */ break; case 319: #line 1764 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string)) { strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); block_state.flags.value |= CONF_FLAGS_SPOOF_IP; } else ilog(LOG_TYPE_IRCD, "Spoof either is too long or contains invalid characters. Ignoring it."); } #line 4727 "conf_parser.c" /* yacc.c:1646 */ break; case 320: #line 1778 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); block_state.flags.value |= CONF_FLAGS_REDIR; } #line 4739 "conf_parser.c" /* yacc.c:1646 */ break; case 321: #line 1787 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; block_state.flags.value |= CONF_FLAGS_REDIR; block_state.port.value = (yyvsp[-1].number); } #line 4751 "conf_parser.c" /* yacc.c:1646 */ break; case 322: #line 1800 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf)); } #line 4763 "conf_parser.c" /* yacc.c:1646 */ break; case 323: #line 1807 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); } #line 4774 "conf_parser.c" /* yacc.c:1646 */ break; case 330: #line 1818 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 4783 "conf_parser.c" /* yacc.c:1646 */ break; case 331: #line 1824 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 4792 "conf_parser.c" /* yacc.c:1646 */ break; case 332: #line 1830 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); } #line 4801 "conf_parser.c" /* yacc.c:1646 */ break; case 338: #line 1845 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if (valid_servname(yylval.string)) { struct MaskItem *conf = conf_make(CONF_SERVICE); conf->name = xstrdup(yylval.string); } } #line 4816 "conf_parser.c" /* yacc.c:1646 */ break; case 339: #line 1860 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf)); strlcpy(block_state.user.buf, "*", sizeof(block_state.user.buf)); strlcpy(block_state.host.buf, "*", sizeof(block_state.host.buf)); block_state.flags.value = SHARED_ALL; } #line 4832 "conf_parser.c" /* yacc.c:1646 */ break; case 340: #line 1871 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; conf = conf_make(CONF_ULINE); conf->flags = block_state.flags.value; conf->name = xstrdup(block_state.name.buf); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); } #line 4849 "conf_parser.c" /* yacc.c:1646 */ break; case 347: #line 1888 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 4858 "conf_parser.c" /* yacc.c:1646 */ break; case 348: #line 1894 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { struct split_nuh_item nuh; nuh.nuhmask = yylval.string; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); } } #line 4880 "conf_parser.c" /* yacc.c:1646 */ break; case 349: #line 1913 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value = 0; } #line 4889 "conf_parser.c" /* yacc.c:1646 */ break; case 353: #line 1920 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_KLINE; } #line 4898 "conf_parser.c" /* yacc.c:1646 */ break; case 354: #line 1924 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNKLINE; } #line 4907 "conf_parser.c" /* yacc.c:1646 */ break; case 355: #line 1928 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_DLINE; } #line 4916 "conf_parser.c" /* yacc.c:1646 */ break; case 356: #line 1932 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNDLINE; } #line 4925 "conf_parser.c" /* yacc.c:1646 */ break; case 357: #line 1936 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_XLINE; } #line 4934 "conf_parser.c" /* yacc.c:1646 */ break; case 358: #line 1940 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNXLINE; } #line 4943 "conf_parser.c" /* yacc.c:1646 */ break; case 359: #line 1944 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_RESV; } #line 4952 "conf_parser.c" /* yacc.c:1646 */ break; case 360: #line 1948 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNRESV; } #line 4961 "conf_parser.c" /* yacc.c:1646 */ break; case 361: #line 1952 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_LOCOPS; } #line 4970 "conf_parser.c" /* yacc.c:1646 */ break; case 362: #line 1956 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value = SHARED_ALL; } #line 4979 "conf_parser.c" /* yacc.c:1646 */ break; case 363: #line 1965 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf)); block_state.flags.value = SHARED_ALL; } #line 4993 "conf_parser.c" /* yacc.c:1646 */ break; case 364: #line 1974 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; conf = conf_make(CONF_CLUSTER); conf->flags = block_state.flags.value; conf->name = xstrdup(block_state.name.buf); } #line 5008 "conf_parser.c" /* yacc.c:1646 */ break; case 370: #line 1989 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 5017 "conf_parser.c" /* yacc.c:1646 */ break; case 371: #line 1995 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value = 0; } #line 5026 "conf_parser.c" /* yacc.c:1646 */ break; case 375: #line 2002 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_KLINE; } #line 5035 "conf_parser.c" /* yacc.c:1646 */ break; case 376: #line 2006 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNKLINE; } #line 5044 "conf_parser.c" /* yacc.c:1646 */ break; case 377: #line 2010 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_DLINE; } #line 5053 "conf_parser.c" /* yacc.c:1646 */ break; case 378: #line 2014 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNDLINE; } #line 5062 "conf_parser.c" /* yacc.c:1646 */ break; case 379: #line 2018 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_XLINE; } #line 5071 "conf_parser.c" /* yacc.c:1646 */ break; case 380: #line 2022 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNXLINE; } #line 5080 "conf_parser.c" /* yacc.c:1646 */ break; case 381: #line 2026 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_RESV; } #line 5089 "conf_parser.c" /* yacc.c:1646 */ break; case 382: #line 2030 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNRESV; } #line 5098 "conf_parser.c" /* yacc.c:1646 */ break; case 383: #line 2034 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_LOCOPS; } #line 5107 "conf_parser.c" /* yacc.c:1646 */ break; case 384: #line 2038 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value = SHARED_ALL; } #line 5116 "conf_parser.c" /* yacc.c:1646 */ break; case 385: #line 2047 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; reset_block_state(); block_state.aftype.value = AF_INET; block_state.port.value = PORTNUM; } #line 5130 "conf_parser.c" /* yacc.c:1646 */ break; case 386: #line 2056 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; struct addrinfo hints, *res; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0] || !block_state.host.buf[0]) break; if (!block_state.rpass.buf[0] || !block_state.spass.buf[0]) break; if (has_wildcards(block_state.name.buf) || has_wildcards(block_state.host.buf)) break; conf = conf_make(CONF_SERVER); conf->port = block_state.port.value; conf->flags = block_state.flags.value; conf->aftype = block_state.aftype.value; conf->host = xstrdup(block_state.host.buf); conf->name = xstrdup(block_state.name.buf); conf->passwd = xstrdup(block_state.rpass.buf); conf->spasswd = xstrdup(block_state.spass.buf); if (block_state.cert.buf[0]) conf->certfp = xstrdup(block_state.cert.buf); if (block_state.ciph.buf[0]) conf->cipher_list = xstrdup(block_state.ciph.buf); dlinkMoveList(&block_state.leaf.list, &conf->leaf_list); dlinkMoveList(&block_state.hub.list, &conf->hub_list); if (block_state.bind.buf[0]) { memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(block_state.bind.buf, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf); else { assert(res != NULL); memcpy(&conf->bind, res->ai_addr, res->ai_addrlen); conf->bind.ss.ss_family = res->ai_family; conf->bind.ss_len = res->ai_addrlen; freeaddrinfo(res); } } conf_add_class_to_conf(conf, block_state.class.buf); lookup_confhost(conf); } #line 5196 "conf_parser.c" /* yacc.c:1646 */ break; case 404: #line 2128 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 5205 "conf_parser.c" /* yacc.c:1646 */ break; case 405: #line 2134 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf)); } #line 5214 "conf_parser.c" /* yacc.c:1646 */ break; case 406: #line 2140 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf)); } #line 5223 "conf_parser.c" /* yacc.c:1646 */ break; case 407: #line 2146 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if ((yyvsp[-1].string)[0] == ':') conf_error_report("Server passwords cannot begin with a colon"); else if (strchr((yyvsp[-1].string), ' ') != NULL) conf_error_report("Server passwords cannot contain spaces"); else strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf)); } #line 5239 "conf_parser.c" /* yacc.c:1646 */ break; case 408: #line 2159 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass != 2) break; if ((yyvsp[-1].string)[0] == ':') conf_error_report("Server passwords cannot begin with a colon"); else if (strchr((yyvsp[-1].string), ' ') != NULL) conf_error_report("Server passwords cannot contain spaces"); else strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 5255 "conf_parser.c" /* yacc.c:1646 */ break; case 409: #line 2172 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); } #line 5264 "conf_parser.c" /* yacc.c:1646 */ break; case 410: #line 2178 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.port.value = (yyvsp[-1].number); } #line 5273 "conf_parser.c" /* yacc.c:1646 */ break; case 411: #line 2184 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.aftype.value = AF_INET; } #line 5282 "conf_parser.c" /* yacc.c:1646 */ break; case 412: #line 2188 "conf_parser.y" /* yacc.c:1646 */ { #ifdef IPV6 if (conf_parser_ctx.pass == 2) block_state.aftype.value = AF_INET6; #endif } #line 5293 "conf_parser.c" /* yacc.c:1646 */ break; case 413: #line 2196 "conf_parser.y" /* yacc.c:1646 */ { block_state.flags.value &= CONF_FLAGS_ENCRYPTED; } #line 5301 "conf_parser.c" /* yacc.c:1646 */ break; case 417: #line 2202 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_ALLOW_AUTO_CONN; } #line 5310 "conf_parser.c" /* yacc.c:1646 */ break; case 418: #line 2206 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_SSL; } #line 5319 "conf_parser.c" /* yacc.c:1646 */ break; case 419: #line 2212 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; } } #line 5333 "conf_parser.c" /* yacc.c:1646 */ break; case 420: #line 2223 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list); } #line 5342 "conf_parser.c" /* yacc.c:1646 */ break; case 421: #line 2229 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list); } #line 5351 "conf_parser.c" /* yacc.c:1646 */ break; case 422: #line 2235 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); } #line 5360 "conf_parser.c" /* yacc.c:1646 */ break; case 423: #line 2241 "conf_parser.y" /* yacc.c:1646 */ { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2) strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf)); #else if (conf_parser_ctx.pass == 2) conf_error_report("Ignoring connect::ciphers -- no OpenSSL support"); #endif } #line 5374 "conf_parser.c" /* yacc.c:1646 */ break; case 424: #line 2256 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 5383 "conf_parser.c" /* yacc.c:1646 */ break; case 425: #line 2260 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.user.buf[0] || !block_state.host.buf[0]) break; conf = conf_make(CONF_KLINE); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_KLINE, conf); } #line 5408 "conf_parser.c" /* yacc.c:1646 */ break; case 431: #line 2285 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { struct split_nuh_item nuh; nuh.nuhmask = yylval.string; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); } } #line 5431 "conf_parser.c" /* yacc.c:1646 */ break; case 432: #line 2305 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 5440 "conf_parser.c" /* yacc.c:1646 */ break; case 433: #line 2314 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 5449 "conf_parser.c" /* yacc.c:1646 */ break; case 434: #line 2318 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.addr.buf[0]) break; if (parse_netmask(block_state.addr.buf, NULL, NULL) != HM_HOST) { conf = conf_make(CONF_DLINE); conf->host = xstrdup(block_state.addr.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_DLINE, conf); } } #line 5475 "conf_parser.c" /* yacc.c:1646 */ break; case 440: #line 2344 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); } #line 5484 "conf_parser.c" /* yacc.c:1646 */ break; case 441: #line 2350 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 5493 "conf_parser.c" /* yacc.c:1646 */ break; case 447: #line 2364 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) { struct MaskItem *conf = conf_make(CONF_EXEMPT); conf->host = xstrdup(yylval.string); add_conf_by_address(CONF_EXEMPT, conf); } } } #line 5510 "conf_parser.c" /* yacc.c:1646 */ break; case 448: #line 2381 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) reset_block_state(); } #line 5519 "conf_parser.c" /* yacc.c:1646 */ break; case 449: #line 2385 "conf_parser.y" /* yacc.c:1646 */ { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0]) break; conf = conf_make(CONF_XLINE); conf->name = xstrdup(block_state.name.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); } #line 5541 "conf_parser.c" /* yacc.c:1646 */ break; case 455: #line 2407 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); } #line 5550 "conf_parser.c" /* yacc.c:1646 */ break; case 456: #line 2413 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); } #line 5559 "conf_parser.c" /* yacc.c:1646 */ break; case 510: #line 2458 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.max_watch = (yyvsp[-1].number); } #line 5567 "conf_parser.c" /* yacc.c:1646 */ break; case 511: #line 2463 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigFileEntry.cycle_on_host_change = yylval.number; } #line 5576 "conf_parser.c" /* yacc.c:1646 */ break; case 512: #line 2469 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigFileEntry.glines = yylval.number; } #line 5585 "conf_parser.c" /* yacc.c:1646 */ break; case 513: #line 2475 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigFileEntry.gline_time = (yyvsp[-1].number); } #line 5594 "conf_parser.c" /* yacc.c:1646 */ break; case 514: #line 2481 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigFileEntry.gline_request_time = (yyvsp[-1].number); } #line 5603 "conf_parser.c" /* yacc.c:1646 */ break; case 515: #line 2487 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.gline_min_cidr = (yyvsp[-1].number); } #line 5611 "conf_parser.c" /* yacc.c:1646 */ break; case 516: #line 2492 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.gline_min_cidr6 = (yyvsp[-1].number); } #line 5619 "conf_parser.c" /* yacc.c:1646 */ break; case 517: #line 2497 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.tkline_expire_notices = yylval.number; } #line 5627 "conf_parser.c" /* yacc.c:1646 */ break; case 518: #line 2502 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.kill_chase_time_limit = (yyvsp[-1].number); } #line 5635 "conf_parser.c" /* yacc.c:1646 */ break; case 519: #line 2507 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.hide_spoof_ips = yylval.number; } #line 5643 "conf_parser.c" /* yacc.c:1646 */ break; case 520: #line 2512 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.ignore_bogus_ts = yylval.number; } #line 5651 "conf_parser.c" /* yacc.c:1646 */ break; case 521: #line 2517 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.failed_oper_notice = yylval.number; } #line 5659 "conf_parser.c" /* yacc.c:1646 */ break; case 522: #line 2522 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.anti_nick_flood = yylval.number; } #line 5667 "conf_parser.c" /* yacc.c:1646 */ break; case 523: #line 2527 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.max_nick_time = (yyvsp[-1].number); } #line 5675 "conf_parser.c" /* yacc.c:1646 */ break; case 524: #line 2532 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.max_nick_changes = (yyvsp[-1].number); } #line 5683 "conf_parser.c" /* yacc.c:1646 */ break; case 525: #line 2537 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.max_accept = (yyvsp[-1].number); } #line 5691 "conf_parser.c" /* yacc.c:1646 */ break; case 526: #line 2542 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.anti_spam_exit_message_time = (yyvsp[-1].number); } #line 5699 "conf_parser.c" /* yacc.c:1646 */ break; case 527: #line 2547 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.ts_warn_delta = (yyvsp[-1].number); } #line 5707 "conf_parser.c" /* yacc.c:1646 */ break; case 528: #line 2552 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigFileEntry.ts_max_delta = (yyvsp[-1].number); } #line 5716 "conf_parser.c" /* yacc.c:1646 */ break; case 529: #line 2558 "conf_parser.y" /* yacc.c:1646 */ { if (((yyvsp[-1].number) > 0) && conf_parser_ctx.pass == 1) { ilog(LOG_TYPE_IRCD, "You haven't read your config file properly."); ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed."); ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line."); exit(0); } } #line 5730 "conf_parser.c" /* yacc.c:1646 */ break; case 530: #line 2569 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.invisible_on_connect = yylval.number; } #line 5738 "conf_parser.c" /* yacc.c:1646 */ break; case 531: #line 2574 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.warn_no_nline = yylval.number; } #line 5746 "conf_parser.c" /* yacc.c:1646 */ break; case 532: #line 2579 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_e_disabled = yylval.number; } #line 5754 "conf_parser.c" /* yacc.c:1646 */ break; case 533: #line 2584 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_o_oper_only = yylval.number; } #line 5762 "conf_parser.c" /* yacc.c:1646 */ break; case 534: #line 2589 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_P_oper_only = yylval.number; } #line 5770 "conf_parser.c" /* yacc.c:1646 */ break; case 535: #line 2594 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_u_oper_only = yylval.number; } #line 5778 "conf_parser.c" /* yacc.c:1646 */ break; case 536: #line 2599 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_k_oper_only = 2 * yylval.number; } #line 5786 "conf_parser.c" /* yacc.c:1646 */ break; case 537: #line 2602 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_k_oper_only = 1; } #line 5794 "conf_parser.c" /* yacc.c:1646 */ break; case 538: #line 2607 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_i_oper_only = 2 * yylval.number; } #line 5802 "conf_parser.c" /* yacc.c:1646 */ break; case 539: #line 2610 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.stats_i_oper_only = 1; } #line 5810 "conf_parser.c" /* yacc.c:1646 */ break; case 540: #line 2615 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.pace_wait = (yyvsp[-1].number); } #line 5818 "conf_parser.c" /* yacc.c:1646 */ break; case 541: #line 2620 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.caller_id_wait = (yyvsp[-1].number); } #line 5826 "conf_parser.c" /* yacc.c:1646 */ break; case 542: #line 2625 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.opers_bypass_callerid = yylval.number; } #line 5834 "conf_parser.c" /* yacc.c:1646 */ break; case 543: #line 2630 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.pace_wait_simple = (yyvsp[-1].number); } #line 5842 "conf_parser.c" /* yacc.c:1646 */ break; case 544: #line 2635 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.short_motd = yylval.number; } #line 5850 "conf_parser.c" /* yacc.c:1646 */ break; case 545: #line 2640 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.no_oper_flood = yylval.number; } #line 5858 "conf_parser.c" /* yacc.c:1646 */ break; case 546: #line 2645 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.true_no_oper_flood = yylval.number; } #line 5866 "conf_parser.c" /* yacc.c:1646 */ break; case 547: #line 2650 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_pass_resv = yylval.number; } #line 5874 "conf_parser.c" /* yacc.c:1646 */ break; case 548: #line 2655 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.dots_in_ident = (yyvsp[-1].number); } #line 5882 "conf_parser.c" /* yacc.c:1646 */ break; case 549: #line 2660 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.max_targets = (yyvsp[-1].number); } #line 5890 "conf_parser.c" /* yacc.c:1646 */ break; case 550: #line 2665 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.use_egd = yylval.number; } #line 5898 "conf_parser.c" /* yacc.c:1646 */ break; case 551: #line 2670 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { MyFree(ConfigFileEntry.egdpool_path); ConfigFileEntry.egdpool_path = xstrdup(yylval.string); } } #line 5910 "conf_parser.c" /* yacc.c:1646 */ break; case 552: #line 2679 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string)) { MyFree(ConfigFileEntry.service_name); ConfigFileEntry.service_name = xstrdup(yylval.string); } } #line 5922 "conf_parser.c" /* yacc.c:1646 */ break; case 553: #line 2688 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.ping_cookie = yylval.number; } #line 5930 "conf_parser.c" /* yacc.c:1646 */ break; case 554: #line 2693 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.disable_auth = yylval.number; } #line 5938 "conf_parser.c" /* yacc.c:1646 */ break; case 555: #line 2698 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.throttle_time = yylval.number; } #line 5946 "conf_parser.c" /* yacc.c:1646 */ break; case 556: #line 2703 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes = 0; } #line 5954 "conf_parser.c" /* yacc.c:1646 */ break; case 560: #line 2709 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_BOTS; } #line 5962 "conf_parser.c" /* yacc.c:1646 */ break; case 561: #line 2712 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_CCONN; } #line 5970 "conf_parser.c" /* yacc.c:1646 */ break; case 562: #line 2715 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_DEAF; } #line 5978 "conf_parser.c" /* yacc.c:1646 */ break; case 563: #line 2718 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_DEBUG; } #line 5986 "conf_parser.c" /* yacc.c:1646 */ break; case 564: #line 2721 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_FULL; } #line 5994 "conf_parser.c" /* yacc.c:1646 */ break; case 565: #line 2724 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_HIDDEN; } #line 6002 "conf_parser.c" /* yacc.c:1646 */ break; case 566: #line 2727 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_SKILL; } #line 6010 "conf_parser.c" /* yacc.c:1646 */ break; case 567: #line 2730 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_NCHANGE; } #line 6018 "conf_parser.c" /* yacc.c:1646 */ break; case 568: #line 2733 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_REJ; } #line 6026 "conf_parser.c" /* yacc.c:1646 */ break; case 569: #line 2736 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_UNAUTH; } #line 6034 "conf_parser.c" /* yacc.c:1646 */ break; case 570: #line 2739 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_SPY; } #line 6042 "conf_parser.c" /* yacc.c:1646 */ break; case 571: #line 2742 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL; } #line 6050 "conf_parser.c" /* yacc.c:1646 */ break; case 572: #line 2745 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_OPERWALL; } #line 6058 "conf_parser.c" /* yacc.c:1646 */ break; case 573: #line 2748 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE; } #line 6066 "conf_parser.c" /* yacc.c:1646 */ break; case 574: #line 2751 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE; } #line 6074 "conf_parser.c" /* yacc.c:1646 */ break; case 575: #line 2754 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_WALLOP; } #line 6082 "conf_parser.c" /* yacc.c:1646 */ break; case 576: #line 2757 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID; } #line 6090 "conf_parser.c" /* yacc.c:1646 */ break; case 577: #line 2760 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_CALLERID; } #line 6098 "conf_parser.c" /* yacc.c:1646 */ break; case 578: #line 2763 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_LOCOPS; } #line 6106 "conf_parser.c" /* yacc.c:1646 */ break; case 579: #line 2766 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_REGONLY; } #line 6114 "conf_parser.c" /* yacc.c:1646 */ break; case 580: #line 2769 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; } #line 6122 "conf_parser.c" /* yacc.c:1646 */ break; case 581: #line 2774 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes = 0; } #line 6130 "conf_parser.c" /* yacc.c:1646 */ break; case 585: #line 2780 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_BOTS; } #line 6138 "conf_parser.c" /* yacc.c:1646 */ break; case 586: #line 2783 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; } #line 6146 "conf_parser.c" /* yacc.c:1646 */ break; case 587: #line 2786 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; } #line 6154 "conf_parser.c" /* yacc.c:1646 */ break; case 588: #line 2789 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG; } #line 6162 "conf_parser.c" /* yacc.c:1646 */ break; case 589: #line 2792 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_FULL; } #line 6170 "conf_parser.c" /* yacc.c:1646 */ break; case 590: #line 2795 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_SKILL; } #line 6178 "conf_parser.c" /* yacc.c:1646 */ break; case 591: #line 2798 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN; } #line 6186 "conf_parser.c" /* yacc.c:1646 */ break; case 592: #line 2801 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE; } #line 6194 "conf_parser.c" /* yacc.c:1646 */ break; case 593: #line 2804 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_REJ; } #line 6202 "conf_parser.c" /* yacc.c:1646 */ break; case 594: #line 2807 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH; } #line 6210 "conf_parser.c" /* yacc.c:1646 */ break; case 595: #line 2810 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_SPY; } #line 6218 "conf_parser.c" /* yacc.c:1646 */ break; case 596: #line 2813 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL; } #line 6226 "conf_parser.c" /* yacc.c:1646 */ break; case 597: #line 2816 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL; } #line 6234 "conf_parser.c" /* yacc.c:1646 */ break; case 598: #line 2819 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE; } #line 6242 "conf_parser.c" /* yacc.c:1646 */ break; case 599: #line 2822 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE; } #line 6250 "conf_parser.c" /* yacc.c:1646 */ break; case 600: #line 2825 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP; } #line 6258 "conf_parser.c" /* yacc.c:1646 */ break; case 601: #line 2828 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID; } #line 6266 "conf_parser.c" /* yacc.c:1646 */ break; case 602: #line 2831 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID; } #line 6274 "conf_parser.c" /* yacc.c:1646 */ break; case 603: #line 2834 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS; } #line 6282 "conf_parser.c" /* yacc.c:1646 */ break; case 604: #line 2837 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY; } #line 6290 "conf_parser.c" /* yacc.c:1646 */ break; case 605: #line 2840 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT; } #line 6298 "conf_parser.c" /* yacc.c:1646 */ break; case 606: #line 2845 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.min_nonwildcard = (yyvsp[-1].number); } #line 6306 "conf_parser.c" /* yacc.c:1646 */ break; case 607: #line 2850 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.min_nonwildcard_simple = (yyvsp[-1].number); } #line 6314 "conf_parser.c" /* yacc.c:1646 */ break; case 608: #line 2855 "conf_parser.y" /* yacc.c:1646 */ { ConfigFileEntry.default_floodcount = (yyvsp[-1].number); } #line 6322 "conf_parser.c" /* yacc.c:1646 */ break; case 625: #line 2878 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.disable_fake_channels = yylval.number; } #line 6330 "conf_parser.c" /* yacc.c:1646 */ break; case 626: #line 2883 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.knock_delay = (yyvsp[-1].number); } #line 6338 "conf_parser.c" /* yacc.c:1646 */ break; case 627: #line 2888 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.knock_delay_channel = (yyvsp[-1].number); } #line 6346 "conf_parser.c" /* yacc.c:1646 */ break; case 628: #line 2893 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.max_chans_per_user = (yyvsp[-1].number); } #line 6354 "conf_parser.c" /* yacc.c:1646 */ break; case 629: #line 2898 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.max_chans_per_oper = (yyvsp[-1].number); } #line 6362 "conf_parser.c" /* yacc.c:1646 */ break; case 630: #line 2903 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.max_bans = (yyvsp[-1].number); } #line 6370 "conf_parser.c" /* yacc.c:1646 */ break; case 631: #line 2908 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.default_split_user_count = (yyvsp[-1].number); } #line 6378 "conf_parser.c" /* yacc.c:1646 */ break; case 632: #line 2913 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.default_split_server_count = (yyvsp[-1].number); } #line 6386 "conf_parser.c" /* yacc.c:1646 */ break; case 633: #line 2918 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.no_create_on_split = yylval.number; } #line 6394 "conf_parser.c" /* yacc.c:1646 */ break; case 634: #line 2923 "conf_parser.y" /* yacc.c:1646 */ { ConfigChannel.no_join_on_split = yylval.number; } #line 6402 "conf_parser.c" /* yacc.c:1646 */ break; case 635: #line 2928 "conf_parser.y" /* yacc.c:1646 */ { GlobalSetOptions.joinfloodcount = yylval.number; } #line 6410 "conf_parser.c" /* yacc.c:1646 */ break; case 636: #line 2933 "conf_parser.y" /* yacc.c:1646 */ { GlobalSetOptions.joinfloodtime = yylval.number; } #line 6418 "conf_parser.c" /* yacc.c:1646 */ break; case 649: #line 2953 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.flatten_links = yylval.number; } #line 6427 "conf_parser.c" /* yacc.c:1646 */ break; case 650: #line 2959 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.disable_remote_commands = yylval.number; } #line 6436 "conf_parser.c" /* yacc.c:1646 */ break; case 651: #line 2965 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_servers = yylval.number; } #line 6445 "conf_parser.c" /* yacc.c:1646 */ break; case 652: #line 2971 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_services = yylval.number; } #line 6454 "conf_parser.c" /* yacc.c:1646 */ break; case 653: #line 2977 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { MyFree(ConfigServerHide.hidden_name); ConfigServerHide.hidden_name = xstrdup(yylval.string); } } #line 6466 "conf_parser.c" /* yacc.c:1646 */ break; case 654: #line 2986 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) { if (((yyvsp[-1].number) > 0) && ConfigServerHide.links_disabled == 1) { eventAddIsh("write_links_file", write_links_file, NULL, (yyvsp[-1].number)); ConfigServerHide.links_disabled = 0; } ConfigServerHide.links_delay = (yyvsp[-1].number); } } #line 6483 "conf_parser.c" /* yacc.c:1646 */ break; case 655: #line 3000 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.hidden = yylval.number; } #line 6492 "conf_parser.c" /* yacc.c:1646 */ break; case 656: #line 3006 "conf_parser.y" /* yacc.c:1646 */ { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_server_ips = yylval.number; } #line 6501 "conf_parser.c" /* yacc.c:1646 */ break; #line 6505 "conf_parser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } ircd-hybrid-8.1.13.dfsg.1/src/conf_parser.h0000644000175000017500000003046112263053413016451 0ustar domdom/* A Bison parser, made by GNU Bison 3.0.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ #ifndef YY_YY_CONF_PARSER_H_INCLUDED # define YY_YY_CONF_PARSER_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { ACCEPT_PASSWORD = 258, ADMIN = 259, AFTYPE = 260, ANTI_NICK_FLOOD = 261, ANTI_SPAM_EXIT_MESSAGE_TIME = 262, AUTOCONN = 263, BYTES = 264, KBYTES = 265, MBYTES = 266, CALLER_ID_WAIT = 267, CAN_FLOOD = 268, CHANNEL = 269, CIDR_BITLEN_IPV4 = 270, CIDR_BITLEN_IPV6 = 271, CLASS = 272, CONNECT = 273, CONNECTFREQ = 274, CYCLE_ON_HOST_CHANGE = 275, DEFAULT_FLOODCOUNT = 276, DEFAULT_SPLIT_SERVER_COUNT = 277, DEFAULT_SPLIT_USER_COUNT = 278, DENY = 279, DESCRIPTION = 280, DIE = 281, DISABLE_AUTH = 282, DISABLE_FAKE_CHANNELS = 283, DISABLE_REMOTE_COMMANDS = 284, DOTS_IN_IDENT = 285, EGDPOOL_PATH = 286, EMAIL = 287, ENCRYPTED = 288, EXCEED_LIMIT = 289, EXEMPT = 290, FAILED_OPER_NOTICE = 291, FLATTEN_LINKS = 292, GECOS = 293, GENERAL = 294, GLINE = 295, GLINE_DURATION = 296, GLINE_ENABLE = 297, GLINE_EXEMPT = 298, GLINE_MIN_CIDR = 299, GLINE_MIN_CIDR6 = 300, GLINE_REQUEST_DURATION = 301, GLOBAL_KILL = 302, HAVENT_READ_CONF = 303, HIDDEN = 304, HIDDEN_NAME = 305, HIDE_IDLE_FROM_OPERS = 306, HIDE_SERVER_IPS = 307, HIDE_SERVERS = 308, HIDE_SERVICES = 309, HIDE_SPOOF_IPS = 310, HOST = 311, HUB = 312, HUB_MASK = 313, IGNORE_BOGUS_TS = 314, INVISIBLE_ON_CONNECT = 315, IP = 316, IRCD_AUTH = 317, IRCD_FLAGS = 318, IRCD_SID = 319, JOIN_FLOOD_COUNT = 320, JOIN_FLOOD_TIME = 321, KILL = 322, KILL_CHASE_TIME_LIMIT = 323, KLINE = 324, KLINE_EXEMPT = 325, KNOCK_DELAY = 326, KNOCK_DELAY_CHANNEL = 327, LEAF_MASK = 328, LINKS_DELAY = 329, LISTEN = 330, MASK = 331, MAX_ACCEPT = 332, MAX_BANS = 333, MAX_CHANS_PER_OPER = 334, MAX_CHANS_PER_USER = 335, MAX_GLOBAL = 336, MAX_IDENT = 337, MAX_IDLE = 338, MAX_LOCAL = 339, MAX_NICK_CHANGES = 340, MAX_NICK_LENGTH = 341, MAX_NICK_TIME = 342, MAX_NUMBER = 343, MAX_TARGETS = 344, MAX_TOPIC_LENGTH = 345, MAX_WATCH = 346, MIN_IDLE = 347, MIN_NONWILDCARD = 348, MIN_NONWILDCARD_SIMPLE = 349, MODULE = 350, MODULES = 351, MOTD = 352, NAME = 353, NEED_IDENT = 354, NEED_PASSWORD = 355, NETWORK_DESC = 356, NETWORK_NAME = 357, NICK = 358, NO_CREATE_ON_SPLIT = 359, NO_JOIN_ON_SPLIT = 360, NO_OPER_FLOOD = 361, NO_TILDE = 362, NUMBER = 363, NUMBER_PER_CIDR = 364, NUMBER_PER_IP = 365, OPER_ONLY_UMODES = 366, OPER_PASS_RESV = 367, OPER_UMODES = 368, OPERATOR = 369, OPERS_BYPASS_CALLERID = 370, PACE_WAIT = 371, PACE_WAIT_SIMPLE = 372, PASSWORD = 373, PATH = 374, PING_COOKIE = 375, PING_TIME = 376, PORT = 377, QSTRING = 378, RANDOM_IDLE = 379, REASON = 380, REDIRPORT = 381, REDIRSERV = 382, REHASH = 383, REMOTE = 384, REMOTEBAN = 385, RESV = 386, RESV_EXEMPT = 387, RSA_PRIVATE_KEY_FILE = 388, RSA_PUBLIC_KEY_FILE = 389, SECONDS = 390, MINUTES = 391, HOURS = 392, DAYS = 393, WEEKS = 394, MONTHS = 395, YEARS = 396, SEND_PASSWORD = 397, SENDQ = 398, SERVERHIDE = 399, SERVERINFO = 400, SHORT_MOTD = 401, SPOOF = 402, SPOOF_NOTICE = 403, SQUIT = 404, SSL_CERTIFICATE_FILE = 405, SSL_CERTIFICATE_FINGERPRINT = 406, SSL_CONNECTION_REQUIRED = 407, SSL_DH_PARAM_FILE = 408, STATS_E_DISABLED = 409, STATS_I_OPER_ONLY = 410, STATS_K_OPER_ONLY = 411, STATS_O_OPER_ONLY = 412, STATS_P_OPER_ONLY = 413, STATS_U_OPER_ONLY = 414, T_ALL = 415, T_BOTS = 416, T_CALLERID = 417, T_CCONN = 418, T_CLUSTER = 419, T_DEAF = 420, T_DEBUG = 421, T_DLINE = 422, T_EXTERNAL = 423, T_FARCONNECT = 424, T_FILE = 425, T_FULL = 426, T_GLOBOPS = 427, T_INVISIBLE = 428, T_IPV4 = 429, T_IPV6 = 430, T_LOCOPS = 431, T_LOG = 432, T_MAX_CLIENTS = 433, T_NCHANGE = 434, T_NONONREG = 435, T_OPERWALL = 436, T_RECVQ = 437, T_REJ = 438, T_RESTART = 439, T_SERVER = 440, T_SERVICE = 441, T_SERVICES_NAME = 442, T_SERVNOTICE = 443, T_SET = 444, T_SHARED = 445, T_SIZE = 446, T_SKILL = 447, T_SOFTCALLERID = 448, T_SPY = 449, T_SSL = 450, T_SSL_CIPHER_LIST = 451, T_SSL_CLIENT_METHOD = 452, T_SSL_SERVER_METHOD = 453, T_SSLV3 = 454, T_TLSV1 = 455, T_UMODES = 456, T_UNAUTH = 457, T_UNDLINE = 458, T_UNLIMITED = 459, T_UNRESV = 460, T_UNXLINE = 461, T_WALLOP = 462, T_WALLOPS = 463, T_WEBIRC = 464, TBOOL = 465, THROTTLE_TIME = 466, TKLINE_EXPIRE_NOTICES = 467, TMASKED = 468, TRUE_NO_OPER_FLOOD = 469, TS_MAX_DELTA = 470, TS_WARN_DELTA = 471, TWODOTS = 472, TYPE = 473, UNKLINE = 474, USE_EGD = 475, USE_LOGGING = 476, USER = 477, VHOST = 478, VHOST6 = 479, WARN_NO_NLINE = 480, XLINE = 481 }; #endif /* Tokens. */ #define ACCEPT_PASSWORD 258 #define ADMIN 259 #define AFTYPE 260 #define ANTI_NICK_FLOOD 261 #define ANTI_SPAM_EXIT_MESSAGE_TIME 262 #define AUTOCONN 263 #define BYTES 264 #define KBYTES 265 #define MBYTES 266 #define CALLER_ID_WAIT 267 #define CAN_FLOOD 268 #define CHANNEL 269 #define CIDR_BITLEN_IPV4 270 #define CIDR_BITLEN_IPV6 271 #define CLASS 272 #define CONNECT 273 #define CONNECTFREQ 274 #define CYCLE_ON_HOST_CHANGE 275 #define DEFAULT_FLOODCOUNT 276 #define DEFAULT_SPLIT_SERVER_COUNT 277 #define DEFAULT_SPLIT_USER_COUNT 278 #define DENY 279 #define DESCRIPTION 280 #define DIE 281 #define DISABLE_AUTH 282 #define DISABLE_FAKE_CHANNELS 283 #define DISABLE_REMOTE_COMMANDS 284 #define DOTS_IN_IDENT 285 #define EGDPOOL_PATH 286 #define EMAIL 287 #define ENCRYPTED 288 #define EXCEED_LIMIT 289 #define EXEMPT 290 #define FAILED_OPER_NOTICE 291 #define FLATTEN_LINKS 292 #define GECOS 293 #define GENERAL 294 #define GLINE 295 #define GLINE_DURATION 296 #define GLINE_ENABLE 297 #define GLINE_EXEMPT 298 #define GLINE_MIN_CIDR 299 #define GLINE_MIN_CIDR6 300 #define GLINE_REQUEST_DURATION 301 #define GLOBAL_KILL 302 #define HAVENT_READ_CONF 303 #define HIDDEN 304 #define HIDDEN_NAME 305 #define HIDE_IDLE_FROM_OPERS 306 #define HIDE_SERVER_IPS 307 #define HIDE_SERVERS 308 #define HIDE_SERVICES 309 #define HIDE_SPOOF_IPS 310 #define HOST 311 #define HUB 312 #define HUB_MASK 313 #define IGNORE_BOGUS_TS 314 #define INVISIBLE_ON_CONNECT 315 #define IP 316 #define IRCD_AUTH 317 #define IRCD_FLAGS 318 #define IRCD_SID 319 #define JOIN_FLOOD_COUNT 320 #define JOIN_FLOOD_TIME 321 #define KILL 322 #define KILL_CHASE_TIME_LIMIT 323 #define KLINE 324 #define KLINE_EXEMPT 325 #define KNOCK_DELAY 326 #define KNOCK_DELAY_CHANNEL 327 #define LEAF_MASK 328 #define LINKS_DELAY 329 #define LISTEN 330 #define MASK 331 #define MAX_ACCEPT 332 #define MAX_BANS 333 #define MAX_CHANS_PER_OPER 334 #define MAX_CHANS_PER_USER 335 #define MAX_GLOBAL 336 #define MAX_IDENT 337 #define MAX_IDLE 338 #define MAX_LOCAL 339 #define MAX_NICK_CHANGES 340 #define MAX_NICK_LENGTH 341 #define MAX_NICK_TIME 342 #define MAX_NUMBER 343 #define MAX_TARGETS 344 #define MAX_TOPIC_LENGTH 345 #define MAX_WATCH 346 #define MIN_IDLE 347 #define MIN_NONWILDCARD 348 #define MIN_NONWILDCARD_SIMPLE 349 #define MODULE 350 #define MODULES 351 #define MOTD 352 #define NAME 353 #define NEED_IDENT 354 #define NEED_PASSWORD 355 #define NETWORK_DESC 356 #define NETWORK_NAME 357 #define NICK 358 #define NO_CREATE_ON_SPLIT 359 #define NO_JOIN_ON_SPLIT 360 #define NO_OPER_FLOOD 361 #define NO_TILDE 362 #define NUMBER 363 #define NUMBER_PER_CIDR 364 #define NUMBER_PER_IP 365 #define OPER_ONLY_UMODES 366 #define OPER_PASS_RESV 367 #define OPER_UMODES 368 #define OPERATOR 369 #define OPERS_BYPASS_CALLERID 370 #define PACE_WAIT 371 #define PACE_WAIT_SIMPLE 372 #define PASSWORD 373 #define PATH 374 #define PING_COOKIE 375 #define PING_TIME 376 #define PORT 377 #define QSTRING 378 #define RANDOM_IDLE 379 #define REASON 380 #define REDIRPORT 381 #define REDIRSERV 382 #define REHASH 383 #define REMOTE 384 #define REMOTEBAN 385 #define RESV 386 #define RESV_EXEMPT 387 #define RSA_PRIVATE_KEY_FILE 388 #define RSA_PUBLIC_KEY_FILE 389 #define SECONDS 390 #define MINUTES 391 #define HOURS 392 #define DAYS 393 #define WEEKS 394 #define MONTHS 395 #define YEARS 396 #define SEND_PASSWORD 397 #define SENDQ 398 #define SERVERHIDE 399 #define SERVERINFO 400 #define SHORT_MOTD 401 #define SPOOF 402 #define SPOOF_NOTICE 403 #define SQUIT 404 #define SSL_CERTIFICATE_FILE 405 #define SSL_CERTIFICATE_FINGERPRINT 406 #define SSL_CONNECTION_REQUIRED 407 #define SSL_DH_PARAM_FILE 408 #define STATS_E_DISABLED 409 #define STATS_I_OPER_ONLY 410 #define STATS_K_OPER_ONLY 411 #define STATS_O_OPER_ONLY 412 #define STATS_P_OPER_ONLY 413 #define STATS_U_OPER_ONLY 414 #define T_ALL 415 #define T_BOTS 416 #define T_CALLERID 417 #define T_CCONN 418 #define T_CLUSTER 419 #define T_DEAF 420 #define T_DEBUG 421 #define T_DLINE 422 #define T_EXTERNAL 423 #define T_FARCONNECT 424 #define T_FILE 425 #define T_FULL 426 #define T_GLOBOPS 427 #define T_INVISIBLE 428 #define T_IPV4 429 #define T_IPV6 430 #define T_LOCOPS 431 #define T_LOG 432 #define T_MAX_CLIENTS 433 #define T_NCHANGE 434 #define T_NONONREG 435 #define T_OPERWALL 436 #define T_RECVQ 437 #define T_REJ 438 #define T_RESTART 439 #define T_SERVER 440 #define T_SERVICE 441 #define T_SERVICES_NAME 442 #define T_SERVNOTICE 443 #define T_SET 444 #define T_SHARED 445 #define T_SIZE 446 #define T_SKILL 447 #define T_SOFTCALLERID 448 #define T_SPY 449 #define T_SSL 450 #define T_SSL_CIPHER_LIST 451 #define T_SSL_CLIENT_METHOD 452 #define T_SSL_SERVER_METHOD 453 #define T_SSLV3 454 #define T_TLSV1 455 #define T_UMODES 456 #define T_UNAUTH 457 #define T_UNDLINE 458 #define T_UNLIMITED 459 #define T_UNRESV 460 #define T_UNXLINE 461 #define T_WALLOP 462 #define T_WALLOPS 463 #define T_WEBIRC 464 #define TBOOL 465 #define THROTTLE_TIME 466 #define TKLINE_EXPIRE_NOTICES 467 #define TMASKED 468 #define TRUE_NO_OPER_FLOOD 469 #define TS_MAX_DELTA 470 #define TS_WARN_DELTA 471 #define TWODOTS 472 #define TYPE 473 #define UNKLINE 474 #define USE_EGD 475 #define USE_LOGGING 476 #define USER 477 #define VHOST 478 #define VHOST6 479 #define WARN_NO_NLINE 480 #define XLINE 481 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE YYSTYPE; union YYSTYPE { #line 140 "conf_parser.y" /* yacc.c:1909 */ int number; char *string; #line 511 "conf_parser.h" /* yacc.c:1909 */ }; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONF_PARSER_H_INCLUDED */ ircd-hybrid-8.1.13.dfsg.1/src/restart.c0000644000175000017500000000447612263053413015636 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * restart.c: Functions to allow the ircd to restart. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: restart.c 1631 2012-11-01 22:04:01Z michael $ */ #include "stdinc.h" #include "list.h" #include "restart.h" #include "fdlist.h" #include "ircd.h" #include "irc_string.h" #include "send.h" #include "log.h" #include "client.h" /* for UMODE_ALL */ #include "memory.h" #include "conf_db.h" void restart(const char *mesg) { static int was_here = 0; /* redundant due to restarting flag below */ if (was_here++) abort(); server_die(mesg, 1); } void server_die(const char *mesg, int rboot) { char buffer[IRCD_BUFSIZE]; dlink_node *ptr = NULL; struct Client *target_p = NULL; static int was_here = 0; if (rboot && was_here++) abort(); if (EmptyString(mesg)) snprintf(buffer, sizeof(buffer), "Server %s", rboot ? "Restarting" : "Terminating"); else snprintf(buffer, sizeof(buffer), "Server %s: %s", rboot ? "Restarting" : "Terminating", mesg); DLINK_FOREACH(ptr, local_client_list.head) { target_p = ptr->data; sendto_one(target_p, ":%s NOTICE %s :%s", me.name, target_p->name, buffer); } DLINK_FOREACH(ptr, serv_list.head) { target_p = ptr->data; sendto_one(target_p, ":%s ERROR :%s", me.name, buffer); } ilog(LOG_TYPE_IRCD, "%s", buffer); save_all_databases(NULL); send_queued_all(); close_fds(NULL); unlink(pidFileName); if (rboot) { execv(SPATH, myargv); exit(1); } else exit(0); } ircd-hybrid-8.1.13.dfsg.1/src/mempool.c0000644000175000017500000005161112263053413015613 0ustar domdom/* * Copyright (c) 2007-2012, The Tor Project, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * * Neither the names of the copyright owners nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*! \file mempool.c * \brief A pooling allocator * \version $Id: mempool.c 1966 2013-05-08 14:33:07Z michael $ */ #include "stdinc.h" #include "memory.h" #include "event.h" #include "log.h" #include "mempool.h" /** Returns floor(log2(u64)). If u64 is 0, (incorrectly) returns 0. */ static int tor_log2(uint64_t u64) { int r = 0; if (u64 >= (1LLU << 32)) { u64 >>= 32; r = 32; } if (u64 >= (1LLU << 16)) { u64 >>= 16; r += 16; } if (u64 >= (1LLU << 8)) { u64 >>= 8; r += 8; } if (u64 >= (1LLU << 4)) { u64 >>= 4; r += 4; } if (u64 >= (1LLU << 2)) { u64 >>= 2; r += 2; } if (u64 >= (1LLU << 1)) { u64 >>= 1; r += 1; } return r; } /** Return the power of 2 in range [1,UINT64_MAX] closest to u64. If * there are two powers of 2 equally close, round down. */ static uint64_t round_to_power_of_2(uint64_t u64) { int lg2; uint64_t low; uint64_t high; if (u64 == 0) return 1; lg2 = tor_log2(u64); low = 1LLU << lg2; if (lg2 == 63) return low; high = 1LLU << (lg2 + 1); if (high - u64 < u64 - low) return high; else return low; } /* OVERVIEW: * * This is an implementation of memory pools for Tor cells. It may be * useful for you too. * * Generally, a memory pool is an allocation strategy optimized for large * numbers of identically-sized objects. Rather than the elaborate arena * and coalescing strategies you need to get good performance for a * general-purpose malloc(), pools use a series of large memory "chunks", * each of which is carved into a bunch of smaller "items" or * "allocations". * * To get decent performance, you need to: * - Minimize the number of times you hit the underlying allocator. * - Try to keep accesses as local in memory as possible. * - Try to keep the common case fast. * * Our implementation uses three lists of chunks per pool. Each chunk can * be either "full" (no more room for items); "empty" (no items); or * "used" (not full, not empty). There are independent doubly-linked * lists for each state. * * CREDIT: * * I wrote this after looking at 3 or 4 other pooling allocators, but * without copying. The strategy this most resembles (which is funny, * since that's the one I looked at longest ago) is the pool allocator * underlying Python's obmalloc code. Major differences from obmalloc's * pools are: * - We don't even try to be threadsafe. * - We only handle objects of one size. * - Our list of empty chunks is doubly-linked, not singly-linked. * (This could change pretty easily; it's only doubly-linked for * consistency.) * - We keep a list of full chunks (so we can have a "nuke everything" * function). Obmalloc's pools leave full chunks to float unanchored. * * LIMITATIONS: * - Not even slightly threadsafe. * - Likes to have lots of items per chunks. * - One pointer overhead per allocated thing. (The alternative is * something like glib's use of an RB-tree to keep track of what * chunk any given piece of memory is in.) * - Only aligns allocated things to void* level: redefine ALIGNMENT_TYPE * if you need doubles. * - Could probably be optimized a bit; the representation contains * a bit more info than it really needs to have. */ /* Tuning parameters */ /** Largest type that we need to ensure returned memory items are aligned to. * Change this to "double" if we need to be safe for structs with doubles. */ #define ALIGNMENT_TYPE void * /** Increment that we need to align allocated. */ #define ALIGNMENT sizeof(ALIGNMENT_TYPE) /** Largest memory chunk that we should allocate. */ #define MAX_CHUNK (8 *(1L << 20)) /** Smallest memory chunk size that we should allocate. */ #define MIN_CHUNK 4096 typedef struct mp_allocated_t mp_allocated_t; typedef struct mp_chunk_t mp_chunk_t; /** Holds a single allocated item, allocated as part of a chunk. */ struct mp_allocated_t { /** The chunk that this item is allocated in. This adds overhead to each * allocated item, thus making this implementation inappropriate for * very small items. */ mp_chunk_t *in_chunk; union { /** If this item is free, the next item on the free list. */ mp_allocated_t *next_free; /** If this item is not free, the actual memory contents of this item. * (Not actual size.) */ char mem[1]; /** An extra element to the union to insure correct alignment. */ ALIGNMENT_TYPE dummy_; } u; }; /** 'Magic' value used to detect memory corruption. */ #define MP_CHUNK_MAGIC 0x09870123 /** A chunk of memory. Chunks come from malloc; we use them */ struct mp_chunk_t { uint32_t magic; /**< Must be MP_CHUNK_MAGIC if this chunk is valid. */ mp_chunk_t *next; /**< The next free, used, or full chunk in sequence. */ mp_chunk_t *prev; /**< The previous free, used, or full chunk in sequence. */ mp_pool_t *pool; /**< The pool that this chunk is part of. */ /** First free item in the freelist for this chunk. Note that this may be * NULL even if this chunk is not at capacity: if so, the free memory at * next_mem has not yet been carved into items. */ mp_allocated_t *first_free; int n_allocated; /**< Number of currently allocated items in this chunk. */ int capacity; /**< Number of items that can be fit into this chunk. */ size_t mem_size; /**< Number of usable bytes in mem. */ char *next_mem; /**< Pointer into part of mem not yet carved up. */ char mem[]; /**< Storage for this chunk. */ }; static mp_pool_t *mp_allocated_pools = NULL; /** Number of extra bytes needed beyond mem_size to allocate a chunk. */ #define CHUNK_OVERHEAD offsetof(mp_chunk_t, mem[0]) /** Given a pointer to a mp_allocated_t, return a pointer to the memory * item it holds. */ #define A2M(a) (&(a)->u.mem) /** Given a pointer to a memory_item_t, return a pointer to its enclosing * mp_allocated_t. */ #define M2A(p) (((char *)p) - offsetof(mp_allocated_t, u.mem)) void mp_pool_init(void) { eventAdd("mp_pool_garbage_collect", &mp_pool_garbage_collect, NULL, 119); } /** Helper: Allocate and return a new memory chunk for pool. Does not * link the chunk into any list. */ static mp_chunk_t * mp_chunk_new(mp_pool_t *pool) { size_t sz = pool->new_chunk_capacity * pool->item_alloc_size; mp_chunk_t *chunk = MyMalloc(CHUNK_OVERHEAD + sz); #ifdef MEMPOOL_STATS ++pool->total_chunks_allocated; #endif chunk->magic = MP_CHUNK_MAGIC; chunk->capacity = pool->new_chunk_capacity; chunk->mem_size = sz; chunk->next_mem = chunk->mem; chunk->pool = pool; return chunk; } /** Take a chunk that has just been allocated or removed from * pool's empty chunk list, and add it to the head of the used chunk * list. */ static void add_newly_used_chunk_to_used_list(mp_pool_t *pool, mp_chunk_t *chunk) { chunk->next = pool->used_chunks; if (chunk->next) chunk->next->prev = chunk; pool->used_chunks = chunk; assert(!chunk->prev); } /** Return a newly allocated item from pool. */ void * mp_pool_get(mp_pool_t *pool) { mp_chunk_t *chunk; mp_allocated_t *allocated; if (pool->used_chunks != NULL) { /* * Common case: there is some chunk that is neither full nor empty. Use * that one. (We can't use the full ones, obviously, and we should fill * up the used ones before we start on any empty ones. */ chunk = pool->used_chunks; } else if (pool->empty_chunks) { /* * We have no used chunks, but we have an empty chunk that we haven't * freed yet: use that. (We pull from the front of the list, which should * get us the most recently emptied chunk.) */ chunk = pool->empty_chunks; /* Remove the chunk from the empty list. */ pool->empty_chunks = chunk->next; if (chunk->next) chunk->next->prev = NULL; /* Put the chunk on the 'used' list*/ add_newly_used_chunk_to_used_list(pool, chunk); assert(!chunk->prev); --pool->n_empty_chunks; if (pool->n_empty_chunks < pool->min_empty_chunks) pool->min_empty_chunks = pool->n_empty_chunks; } else { /* We have no used or empty chunks: allocate a new chunk. */ chunk = mp_chunk_new(pool); /* Add the new chunk to the used list. */ add_newly_used_chunk_to_used_list(pool, chunk); } assert(chunk->n_allocated < chunk->capacity); if (chunk->first_free) { /* If there's anything on the chunk's freelist, unlink it and use it. */ allocated = chunk->first_free; chunk->first_free = allocated->u.next_free; allocated->u.next_free = NULL; /* For debugging; not really needed. */ assert(allocated->in_chunk == chunk); } else { /* Otherwise, the chunk had better have some free space left on it. */ assert(chunk->next_mem + pool->item_alloc_size <= chunk->mem + chunk->mem_size); /* Good, it did. Let's carve off a bit of that free space, and use * that. */ allocated = (void *)chunk->next_mem; chunk->next_mem += pool->item_alloc_size; allocated->in_chunk = chunk; allocated->u.next_free = NULL; /* For debugging; not really needed. */ } ++chunk->n_allocated; #ifdef MEMPOOL_STATS ++pool->total_items_allocated; #endif if (chunk->n_allocated == chunk->capacity) { /* This chunk just became full. */ assert(chunk == pool->used_chunks); assert(chunk->prev == NULL); /* Take it off the used list. */ pool->used_chunks = chunk->next; if (chunk->next) chunk->next->prev = NULL; /* Put it on the full list. */ chunk->next = pool->full_chunks; if (chunk->next) chunk->next->prev = chunk; pool->full_chunks = chunk; } /* And return the memory portion of the mp_allocated_t. */ return A2M(allocated); } /** Return an allocated memory item to its memory pool. */ void mp_pool_release(void *item) { mp_allocated_t *allocated = (void *)M2A(item); mp_chunk_t *chunk = allocated->in_chunk; assert(chunk); assert(chunk->magic == MP_CHUNK_MAGIC); assert(chunk->n_allocated > 0); allocated->u.next_free = chunk->first_free; chunk->first_free = allocated; if (chunk->n_allocated == chunk->capacity) { /* This chunk was full and is about to be used. */ mp_pool_t *pool = chunk->pool; /* unlink from the full list */ if (chunk->prev) chunk->prev->next = chunk->next; if (chunk->next) chunk->next->prev = chunk->prev; if (chunk == pool->full_chunks) pool->full_chunks = chunk->next; /* link to the used list. */ chunk->next = pool->used_chunks; chunk->prev = NULL; if (chunk->next) chunk->next->prev = chunk; pool->used_chunks = chunk; } else if (chunk->n_allocated == 1) { /* This was used and is about to be empty. */ mp_pool_t *pool = chunk->pool; /* Unlink from the used list */ if (chunk->prev) chunk->prev->next = chunk->next; if (chunk->next) chunk->next->prev = chunk->prev; if (chunk == pool->used_chunks) pool->used_chunks = chunk->next; /* Link to the empty list */ chunk->next = pool->empty_chunks; chunk->prev = NULL; if (chunk->next) chunk->next->prev = chunk; pool->empty_chunks = chunk; /* Reset the guts of this chunk to defragment it, in case it gets * used again. */ chunk->first_free = NULL; chunk->next_mem = chunk->mem; ++pool->n_empty_chunks; } --chunk->n_allocated; } /** Allocate a new memory pool to hold items of size item_size. We'll * try to fit about chunk_capacity bytes in each chunk. */ mp_pool_t * mp_pool_new(size_t item_size, size_t chunk_capacity) { mp_pool_t *pool; size_t alloc_size, new_chunk_cap; /* assert(item_size < SIZE_T_CEILING); assert(chunk_capacity < SIZE_T_CEILING); assert(SIZE_T_CEILING / item_size > chunk_capacity); */ pool = MyMalloc(sizeof(mp_pool_t)); /* * First, we figure out how much space to allow per item. We'll want to * use make sure we have enough for the overhead plus the item size. */ alloc_size = (size_t)(offsetof(mp_allocated_t, u.mem) + item_size); /* * If the item_size is less than sizeof(next_free), we need to make * the allocation bigger. */ if (alloc_size < sizeof(mp_allocated_t)) alloc_size = sizeof(mp_allocated_t); /* If we're not an even multiple of ALIGNMENT, round up. */ if (alloc_size % ALIGNMENT) { alloc_size = alloc_size + ALIGNMENT - (alloc_size % ALIGNMENT); } if (alloc_size < ALIGNMENT) alloc_size = ALIGNMENT; assert((alloc_size % ALIGNMENT) == 0); /* * Now we figure out how many items fit in each chunk. We need to fit at * least 2 items per chunk. No chunk can be more than MAX_CHUNK bytes long, * or less than MIN_CHUNK. */ if (chunk_capacity > MAX_CHUNK) chunk_capacity = MAX_CHUNK; /* * Try to be around a power of 2 in size, since that's what allocators like * handing out. 512K-1 byte is a lot better than 512K+1 byte. */ chunk_capacity = (size_t) round_to_power_of_2(chunk_capacity); while (chunk_capacity < alloc_size * 2 + CHUNK_OVERHEAD) chunk_capacity *= 2; if (chunk_capacity < MIN_CHUNK) chunk_capacity = MIN_CHUNK; new_chunk_cap = (chunk_capacity-CHUNK_OVERHEAD) / alloc_size; assert(new_chunk_cap < INT_MAX); pool->new_chunk_capacity = (int)new_chunk_cap; pool->item_alloc_size = alloc_size; pool->next = mp_allocated_pools; mp_allocated_pools = pool; ilog(LOG_TYPE_DEBUG, "Capacity is %lu, item size is %lu, alloc size is %lu", (unsigned long)pool->new_chunk_capacity, (unsigned long)pool->item_alloc_size, (unsigned long)(pool->new_chunk_capacity*pool->item_alloc_size)); return pool; } /** Helper function for qsort: used to sort pointers to mp_chunk_t into * descending order of fullness. */ static int mp_pool_sort_used_chunks_helper(const void *_a, const void *_b) { mp_chunk_t *a = *(mp_chunk_t * const *)_a; mp_chunk_t *b = *(mp_chunk_t * const *)_b; return b->n_allocated - a->n_allocated; } /** Sort the used chunks in pool into descending order of fullness, * so that we preferentially fill up mostly full chunks before we make * nearly empty chunks less nearly empty. */ static void mp_pool_sort_used_chunks(mp_pool_t *pool) { int i, n = 0, inverted = 0; mp_chunk_t **chunks, *chunk; for (chunk = pool->used_chunks; chunk; chunk = chunk->next) { ++n; if (chunk->next && chunk->next->n_allocated > chunk->n_allocated) ++inverted; } if (!inverted) return; chunks = MyMalloc(sizeof(mp_chunk_t *) * n); for (i=0,chunk = pool->used_chunks; chunk; chunk = chunk->next) chunks[i++] = chunk; qsort(chunks, n, sizeof(mp_chunk_t *), mp_pool_sort_used_chunks_helper); pool->used_chunks = chunks[0]; chunks[0]->prev = NULL; for (i = 1; i < n; ++i) { chunks[i - 1]->next = chunks[i]; chunks[i]->prev = chunks[i - 1]; } chunks[n - 1]->next = NULL; MyFree(chunks); mp_pool_assert_ok(pool); } /** If there are more than n empty chunks in pool, free the * excess ones that have been empty for the longest. If * keep_recently_used is true, do not free chunks unless they have been * empty since the last call to this function. **/ void mp_pool_clean(mp_pool_t *pool, int n_to_keep, int keep_recently_used) { mp_chunk_t *chunk, **first_to_free; mp_pool_sort_used_chunks(pool); assert(n_to_keep >= 0); if (keep_recently_used) { int n_recently_used = pool->n_empty_chunks - pool->min_empty_chunks; if (n_to_keep < n_recently_used) n_to_keep = n_recently_used; } assert(n_to_keep >= 0); first_to_free = &pool->empty_chunks; while (*first_to_free && n_to_keep > 0) { first_to_free = &(*first_to_free)->next; --n_to_keep; } if (!*first_to_free) { pool->min_empty_chunks = pool->n_empty_chunks; return; } chunk = *first_to_free; while (chunk) { mp_chunk_t *next = chunk->next; chunk->magic = 0xdeadbeef; MyFree(chunk); #ifdef MEMPOOL_STATS ++pool->total_chunks_freed; #endif --pool->n_empty_chunks; chunk = next; } pool->min_empty_chunks = pool->n_empty_chunks; *first_to_free = NULL; } /** Helper: Given a list of chunks, free all the chunks in the list. */ static void destroy_chunks(mp_chunk_t *chunk) { mp_chunk_t *next; while (chunk) { chunk->magic = 0xd3adb33f; next = chunk->next; MyFree(chunk); chunk = next; } } /** Helper: make sure that a given chunk list is not corrupt. */ static int assert_chunks_ok(mp_pool_t *pool, mp_chunk_t *chunk, int empty, int full) { mp_allocated_t *allocated; int n = 0; if (chunk) assert(chunk->prev == NULL); while (chunk) { n++; assert(chunk->magic == MP_CHUNK_MAGIC); assert(chunk->pool == pool); for (allocated = chunk->first_free; allocated; allocated = allocated->u.next_free) { assert(allocated->in_chunk == chunk); } if (empty) assert(chunk->n_allocated == 0); else if (full) assert(chunk->n_allocated == chunk->capacity); else assert(chunk->n_allocated > 0 && chunk->n_allocated < chunk->capacity); assert(chunk->capacity == pool->new_chunk_capacity); assert(chunk->mem_size == pool->new_chunk_capacity * pool->item_alloc_size); assert(chunk->next_mem >= chunk->mem && chunk->next_mem <= chunk->mem + chunk->mem_size); if (chunk->next) assert(chunk->next->prev == chunk); chunk = chunk->next; } return n; } /** Fail with an assertion if pool is not internally consistent. */ void mp_pool_assert_ok(mp_pool_t *pool) { int n_empty; n_empty = assert_chunks_ok(pool, pool->empty_chunks, 1, 0); assert_chunks_ok(pool, pool->full_chunks, 0, 1); assert_chunks_ok(pool, pool->used_chunks, 0, 0); assert(pool->n_empty_chunks == n_empty); } void mp_pool_garbage_collect(void *arg) { mp_pool_t *pool = mp_allocated_pools; for (; pool; pool = pool->next) mp_pool_clean(pool, 0, 1); } /** Dump information about pool's memory usage to the Tor log at level * severity. */ void mp_pool_log_status(mp_pool_t *pool) { uint64_t bytes_used = 0; uint64_t bytes_allocated = 0; uint64_t bu = 0, ba = 0; mp_chunk_t *chunk; int n_full = 0, n_used = 0; assert(pool); for (chunk = pool->empty_chunks; chunk; chunk = chunk->next) bytes_allocated += chunk->mem_size; ilog(LOG_TYPE_DEBUG, "%llu bytes in %d empty chunks", bytes_allocated, pool->n_empty_chunks); for (chunk = pool->used_chunks; chunk; chunk = chunk->next) { ++n_used; bu += chunk->n_allocated * pool->item_alloc_size; ba += chunk->mem_size; ilog(LOG_TYPE_DEBUG, " used chunk: %d items allocated", chunk->n_allocated); } ilog(LOG_TYPE_DEBUG, "%llu/%llu bytes in %d partially full chunks", bu, ba, n_used); bytes_used += bu; bytes_allocated += ba; bu = ba = 0; for (chunk = pool->full_chunks; chunk; chunk = chunk->next) { ++n_full; bu += chunk->n_allocated * pool->item_alloc_size; ba += chunk->mem_size; } ilog(LOG_TYPE_DEBUG, "%llu/%llu bytes in %d full chunks", bu, ba, n_full); bytes_used += bu; bytes_allocated += ba; ilog(LOG_TYPE_DEBUG, "Total: %llu/%llu bytes allocated " "for cell pools are full.", bytes_used, bytes_allocated); #ifdef MEMPOOL_STATS ilog(LOG_TYPE_DEBUG, "%llu cell allocations ever; " "%llu chunk allocations ever; " "%llu chunk frees ever.", pool->total_items_allocated, pool->total_chunks_allocated, pool->total_chunks_freed); #endif } ircd-hybrid-8.1.13.dfsg.1/src/version.c0000644000175000017500000001031112263053413015620 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: version.c 2731 2014-01-01 14:13:47Z michael $ */ #include "patchlevel.h" #include "serno.h" #include "ircd.h" const char *ircd_version = PATCHLEVEL; const char *serno = SERIALNUM; const char *infotext[] = { "ircd-hybrid --", "Based on the original code written by Jarkko Oikarinen", "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center", "Copyright (c) 1997-2014 Hybrid Development Team", "", "This program is free software; you can redistribute it and/or", "modify it under the terms of the GNU General Public License as", "published by the Free Software Foundation; either version 2, or", "(at your option) any later version.", "", "", "The hybrid team is a group of ircd coders who were frustrated", "with the instability and all-out dirtiness of the EFnet ircd's", "available. hybrid is the name for the collective efforts of a group", "of people, all of us.", "", "Anyone is welcome to contribute to this effort. You are encouraged", "to participate in the Hybrid mailing list. To subscribe to the", "Hybrid List, use this link:", " https://lists.ircd-hybrid.org/mailman/listinfo/hybrid", "", "The core team as, of this major release:", "", "billy-jon, William Bierman III ", "cryogen, Stuart Walsh ", "Dianora, Diane Bruce ", "metalrock, Jack Low ", "Michael, Michael Wobst ", "Rodder, Jon Lusky ", "Wohali, Joan Touzet ", "", "The following people have contributed blood, sweat, and/or code to", "recent releases of Hybrid, in nick alphabetical order:", "", "A1kmm, Andrew Miller ", "adx, Piotr Nizynski ", "AndroSyn, Aaron Sethman ", "bane, Dragan Dosen ", "bysin, Ben Kittridge ", "cosine, Patrick Alken ", "David-T, David Taylor ", "Dom, Dominic Hargreaves ", "fgeek, Henri Salo ", "fl, Lee Hardy ", "Garion, Joost Vunderink ", "Habeeb, David Supuran ", "Hwy101, W. Campbell ", "jmallett, Juli Mallett ", "joshk, Joshua Kwan ", "jv, Jakub Vlasek ", "k9, Jeremy Chadwick ", "kire, Erik Small ", "knight, Alan LeVee ", "kre, Dinko Korunic ", "madmax, Paul Lomax ", "Riedel, Dennis Vink, ", "scuzzy, David Todd ", "spookey, David Colburn ", "TimeMr14C, Yusuf Iskenderoglu ", "toot, Toby Verrall ", "vx0, Mark Miller ", "wiz, Jason Dambrosio ", "Xride, Søren Straarup ", "zb^3, Alfred Perlstein ", "", "Others are welcome. Always. And if we left anyone off the above list,", "be sure to let us know that too. Many others have contributed to", "previous versions of this ircd and its ancestors, too many to list", "here.", "", "Send bug fixes/complaints/rotten tomatoes to bugs@ircd-hybrid.org.", "", 0 }; ircd-hybrid-8.1.13.dfsg.1/src/watch.c0000644000175000017500000001435512263053413015255 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 1997 Jukka Santala (Donwulff) * Copyright (C) 2005 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file watch.c * \brief File including functions for WATCH support * \version $Id: watch.c 2298 2013-06-19 11:58:34Z michael $ */ #include "stdinc.h" #include "list.h" #include "client.h" #include "hash.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "conf.h" #include "send.h" #include "mempool.h" #include "watch.h" static dlink_list watchTable[HASHSIZE]; static mp_pool_t *watch_pool = NULL; /*! \brief Initializes the watch table */ void watch_init(void) { watch_pool = mp_pool_new(sizeof(struct Watch), MP_CHUNK_SIZE_WATCH); } /* * Rough figure of the datastructures for watch: * * NOTIFY HASH client_p1 * | |- nick1 * nick1-|- client_p1 |- nick2 * | |- client_p2 client_p3 * | |- client_p3 client_p2 |- nick1 * | |- nick1 * nick2-|- client_p2 |- nick2 * |- client_p1 */ /*! \brief Counts up memory used by watch list headers */ void watch_count_memory(unsigned int *const count, uint64_t *const bytes) { unsigned int idx = 0; for (; idx < HASHSIZE; ++idx) (*count) += dlink_list_length(&watchTable[idx]); (*bytes) = *count * sizeof(struct Watch); } /*! \brief Notifies all clients that have client_p's nick name on * their watch list. * \param client_p pointer to Client struct * \param reply numeric to send. Either RPL_LOGON or RPL_LOGOFF */ void watch_check_hash(struct Client *client_p, const unsigned int reply) { struct Watch *anptr = NULL; dlink_node *ptr = NULL; assert(IsClient(client_p)); if ((anptr = watch_find_hash(client_p->name)) == NULL) return; /* This nick isn't on watch */ /* Update the time of last change to item */ anptr->lasttime = CurrentTime; /* Send notifies out to everybody on the list in header */ DLINK_FOREACH(ptr, anptr->watched_by.head) { struct Client *target_p = ptr->data; sendto_one(target_p, form_str(reply), me.name, target_p->name, client_p->name, client_p->username, client_p->host, anptr->lasttime, client_p->info); } } /*! \brief Looks up the watch table for a given nick * \param name nick name to look up */ struct Watch * watch_find_hash(const char *name) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, watchTable[strhash(name)].head) { struct Watch *anptr = ptr->data; if (!irccmp(anptr->nick, name)) return anptr; } return NULL; } /*! \brief Adds a watch entry to client_p's watch list * \param nick nick name to add * \param client_p Pointer to Client struct */ void watch_add_to_hash_table(const char *nick, struct Client *client_p) { struct Watch *anptr = NULL; dlink_node *ptr = NULL; /* If found NULL (no header for this nick), make one... */ if ((anptr = watch_find_hash(nick)) == NULL) { anptr = mp_pool_get(watch_pool); memset(anptr, 0, sizeof(*anptr)); anptr->lasttime = CurrentTime; strlcpy(anptr->nick, nick, sizeof(anptr->nick)); dlinkAdd(anptr, &anptr->node, &watchTable[strhash(nick)]); } else { /* Is this client already on the watch-list? */ ptr = dlinkFind(&anptr->watched_by, client_p); } if (ptr == NULL) { /* No it isn't, so add it in the bucket and client addint it */ dlinkAdd(client_p, make_dlink_node(), &anptr->watched_by); dlinkAdd(anptr, make_dlink_node(), &client_p->localClient->watches); } } /*! \brief Removes a single entry from client_p's watch list * \param nick nick name to remove * \param client_p Pointer to Client struct */ void watch_del_from_hash_table(const char *nick, struct Client *client_p) { struct Watch *anptr = NULL; dlink_node *ptr = NULL; if ((anptr = watch_find_hash(nick)) == NULL) return; /* No header found for that nick. i.e. it's not being watched */ if ((ptr = dlinkFind(&anptr->watched_by, client_p)) == NULL) return; /* This nick isn't being watched by client_p */ dlinkDelete(ptr, &anptr->watched_by); free_dlink_node(ptr); if ((ptr = dlinkFindDelete(&client_p->localClient->watches, anptr))) free_dlink_node(ptr); /* In case this header is now empty of notices, remove it */ if (anptr->watched_by.head == NULL) { assert(dlinkFind(&watchTable[strhash(nick)], anptr) != NULL); dlinkDelete(&anptr->node, &watchTable[strhash(nick)]); mp_pool_release(anptr); } } /*! \brief Removes all entries from client_p's watch list * and deletes headers that are no longer being watched. * \param client_p Pointer to Client struct */ void watch_del_watch_list(struct Client *client_p) { dlink_node *ptr = NULL, *ptr_next = NULL; dlink_node *tmp = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, client_p->localClient->watches.head) { struct Watch *anptr = ptr->data; assert(anptr); assert(dlinkFind(&anptr->watched_by, client_p) != NULL); if ((tmp = dlinkFindDelete(&anptr->watched_by, client_p))) free_dlink_node(tmp); /* If this leaves a header without notifies, remove it. */ if (anptr->watched_by.head == NULL) { assert(dlinkFind(&watchTable[strhash(anptr->nick)], anptr) != NULL); dlinkDelete(&anptr->node, &watchTable[strhash(anptr->nick)]); mp_pool_release(anptr); } dlinkDelete(ptr, &client_p->localClient->watches); free_dlink_node(ptr); } assert(client_p->localClient->watches.head == NULL); assert(client_p->localClient->watches.tail == NULL); } ircd-hybrid-8.1.13.dfsg.1/src/irc_reslib.c0000644000175000017500000007141212263053413016261 0ustar domdom/* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Portions Copyright (c) 1993 by Digital Equipment Corporation. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* Original copyright ISC as above. * Code modified specifically for ircd use from the following orginal files * in bind ... * * res_comp.c * ns_name.c * ns_netint.c * res_init.c * * - Dianora */ #include "stdinc.h" #include "ircd_defs.h" #include "irc_res.h" #include "irc_reslib.h" #include "irc_string.h" #define NS_TYPE_ELT 0x40 /* EDNS0 extended label type */ #define DNS_LABELTYPE_BITSTRING 0x41 #define MAXLINE 128 /* $Id: irc_reslib.c 2610 2013-11-28 19:20:30Z michael $ */ struct irc_ssaddr irc_nsaddr_list[IRCD_MAXNS]; int irc_nscount = 0; static const char digits[] = "0123456789"; static const char digitvalue[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*32*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*48*/ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /*64*/ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*80*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*96*/ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*112*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*128*/ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*256*/ }; static int labellen(const unsigned char *lp); static int special(int ch); static int printable(int ch); static int irc_decode_bitstring(const unsigned char **cpp, char *dn, const char *eom); static int irc_ns_name_compress(const char *src, unsigned char *dst, size_t dstsiz, const unsigned char **dnptrs, const unsigned char **lastdnptr); static int irc_dn_find(const unsigned char *, const unsigned char *, const unsigned char * const *, const unsigned char * const *); static int irc_encode_bitsring(const char **, const char *, unsigned char **, unsigned char **, const unsigned char *); static int irc_ns_name_uncompress(const unsigned char *, const unsigned char *, const unsigned char *, char *, size_t); static int irc_ns_name_unpack(const unsigned char *, const unsigned char *, const unsigned char *, unsigned char *, size_t); static int irc_ns_name_ntop(const unsigned char *, char *, size_t); static int irc_ns_name_skip(const unsigned char **, const unsigned char *); static int mklower(int ch); /* add_nameserver() * * input - either an IPV4 address in dotted quad * or an IPV6 address in : format * output - NONE * side effects - entry in irc_nsaddr_list is filled in as needed */ static void add_nameserver(const char *arg) { struct addrinfo hints, *res; /* Done max number of nameservers? */ if (irc_nscount >= IRCD_MAXNS) return; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(arg, "domain", &hints, &res)) return; if (res == NULL) return; memcpy(&irc_nsaddr_list[irc_nscount].ss, res->ai_addr, res->ai_addrlen); irc_nsaddr_list[irc_nscount++].ss_len = res->ai_addrlen; freeaddrinfo(res); } /* parse_resvconf() * * inputs - NONE * output - -1 if failure 0 if success * side effects - fills in irc_nsaddr_list */ static void parse_resvconf(void) { char *p; char *opt; char *arg; char input[MAXLINE]; FILE *file; /* XXX "/etc/resolv.conf" should be from a define in config.h perhaps * for cygwin support etc. this hardcodes it to unix for now -db */ if ((file = fopen("/etc/resolv.conf", "r")) == NULL) return; while (fgets(input, sizeof(input), file) != NULL) { /* blow away any newline */ if ((p = strpbrk(input, "\r\n")) != NULL) *p = '\0'; p = input; /* skip until something thats not a space is seen */ while (IsSpace(*p)) ++p; /* if at this point, have a '\0' then continue */ if (*p == '\0') continue; /* Ignore comment lines immediately */ if (*p == ';' || *p == '#') continue; /* skip until a space is found */ opt = p; while (!IsSpace(*p) && *p) ++p; if (*p == '\0') continue; /* no arguments?.. ignore this line */ /* blow away the space character */ *p++ = '\0'; /* skip these spaces that are before the argument */ while (IsSpace(*p)) ++p; /* Now arg should be right where p is pointing */ arg = p; if ((p = strpbrk(arg, " \t")) != NULL) *p = '\0'; /* take the first word */ if (!irccmp(opt, "nameserver")) add_nameserver(arg); } fclose(file); } void irc_res_init(void) { irc_nscount = 0; memset(irc_nsaddr_list, 0, sizeof(irc_nsaddr_list)); parse_resvconf(); if (!irc_nscount) add_nameserver("127.0.0.1"); } /* * Expand compressed domain name 'comp_dn' to full domain name. * 'msg' is a pointer to the begining of the message, * 'eomorig' points to the first location after the message, * 'exp_dn' is a pointer to a buffer of size 'length' for the result. * Return size of compressed name or -1 if there was an error. */ int irc_dn_expand(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, char *dst, int dstsiz) { int n = irc_ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz); if (n > 0 && dst[0] == '.') dst[0] = '\0'; return(n); } /*2*/ /* * irc_ns_name_uncompress(msg, eom, src, dst, dstsiz) * Expand compressed domain name to presentation format. * return: * Number of bytes read out of `src', or -1 (with errno set). * note: * Root domain returns as "." not "". */ static int irc_ns_name_uncompress(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, char *dst, size_t dstsiz) { unsigned char tmp[NS_MAXCDNAME]; int n; if ((n = irc_ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1) return(-1); if (irc_ns_name_ntop(tmp, dst, dstsiz) == -1) return(-1); return(n); } /*2*/ /* * irc_ns_name_unpack(msg, eom, src, dst, dstsiz) * Unpack a domain name from a message, source may be compressed. * return: * -1 if it fails, or consumed octets if it succeeds. */ static int irc_ns_name_unpack(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, unsigned char *dst, size_t dstsiz) { const unsigned char *srcp, *dstlim; unsigned char *dstp; int n, len, checked, l; len = -1; checked = 0; dstp = dst; srcp = src; dstlim = dst + dstsiz; if (srcp < msg || srcp >= eom) { errno = EMSGSIZE; return (-1); } /* Fetch next label in domain name. */ while ((n = *srcp++) != 0) { /* Check for indirection. */ switch (n & NS_CMPRSFLGS) { case 0: case NS_TYPE_ELT: /* Limit checks. */ if ((l = labellen(srcp - 1)) < 0) { errno = EMSGSIZE; return(-1); } if (dstp + l + 1 >= dstlim || srcp + l >= eom) { errno = EMSGSIZE; return (-1); } checked += l + 1; *dstp++ = n; memcpy(dstp, srcp, l); dstp += l; srcp += l; break; case NS_CMPRSFLGS: if (srcp >= eom) { errno = EMSGSIZE; return (-1); } if (len < 0) len = srcp - src + 1; srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff)); if (srcp < msg || srcp >= eom) { /* Out of range. */ errno = EMSGSIZE; return (-1); } checked += 2; /* * Check for loops in the compressed name; * if we've looked at the whole message, * there must be a loop. */ if (checked >= eom - msg) { errno = EMSGSIZE; return (-1); } break; default: errno = EMSGSIZE; return (-1); /* flag error */ } } *dstp = '\0'; if (len < 0) len = srcp - src; return (len); } /*2*/ /* * irc_ns_name_ntop(src, dst, dstsiz) * Convert an encoded domain name to printable ascii as per RFC1035. * return: * Number of bytes written to buffer, or -1 (with errno set) * notes: * The root is returned as "." * All other domains are returned in non absolute form */ static int irc_ns_name_ntop(const unsigned char *src, char *dst, size_t dstsiz) { const unsigned char *cp; char *dn, *eom; unsigned char c; unsigned int n; int l; cp = src; dn = dst; eom = dst + dstsiz; while ((n = *cp++) != 0) { if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) { /* Some kind of compression pointer. */ errno = EMSGSIZE; return (-1); } if (dn != dst) { if (dn >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = '.'; } if ((l = labellen((cp - 1))) < 0) { errno = EMSGSIZE; /* XXX */ return(-1); } if (dn + l >= eom) { errno = EMSGSIZE; return (-1); } if ((n & NS_CMPRSFLGS) == NS_TYPE_ELT) { int m; if (n != DNS_LABELTYPE_BITSTRING) { /* XXX: labellen should reject this case */ errno = EINVAL; return(-1); } if ((m = irc_decode_bitstring(&cp, dn, eom)) < 0) { errno = EMSGSIZE; return(-1); } dn += m; continue; } for ((void)NULL; l > 0; l--) { c = *cp++; if (special(c)) { if (dn + 1 >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = '\\'; *dn++ = (char)c; } else if (!printable(c)) { if (dn + 3 >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = '\\'; *dn++ = digits[c / 100]; *dn++ = digits[(c % 100) / 10]; *dn++ = digits[c % 10]; } else { if (dn >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = (char)c; } } } if (dn == dst) { if (dn >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = '.'; } if (dn >= eom) { errno = EMSGSIZE; return (-1); } *dn++ = '\0'; return (dn - dst); } /*2*/ /* * Skip over a compressed domain name. Return the size or -1. */ int irc_dn_skipname(const unsigned char *ptr, const unsigned char *eom) { const unsigned char *saveptr = ptr; if (irc_ns_name_skip(&ptr, eom) == -1) return(-1); return(ptr - saveptr); } /*2*/ /* * ns_name_skip(ptrptr, eom) * Advance *ptrptr to skip over the compressed name it points at. * return: * 0 on success, -1 (with errno set) on failure. */ static int irc_ns_name_skip(const unsigned char **ptrptr, const unsigned char *eom) { const unsigned char *cp; unsigned int n; int l; cp = *ptrptr; while (cp < eom && (n = *cp++) != 0) { /* Check for indirection. */ switch (n & NS_CMPRSFLGS) { case 0: /* normal case, n == len */ cp += n; continue; case NS_TYPE_ELT: /* EDNS0 extended label */ if ((l = labellen(cp - 1)) < 0) { errno = EMSGSIZE; /* XXX */ return(-1); } cp += l; continue; case NS_CMPRSFLGS: /* indirection */ cp++; break; default: /* illegal type */ errno = EMSGSIZE; return(-1); } break; } if (cp > eom) { errno = EMSGSIZE; return (-1); } *ptrptr = cp; return(0); } /*2*/ unsigned int irc_ns_get16(const unsigned char *src) { unsigned int dst; IRC_NS_GET16(dst, src); return(dst); } unsigned long irc_ns_get32(const unsigned char *src) { unsigned long dst; IRC_NS_GET32(dst, src); return(dst); } void irc_ns_put16(unsigned int src, unsigned char *dst) { IRC_NS_PUT16(src, dst); } void irc_ns_put32(unsigned long src, unsigned char *dst) { IRC_NS_PUT32(src, dst); } /* From ns_name.c */ /* * special(ch) * Thinking in noninternationalized USASCII (per the DNS spec), * is this characted special ("in need of quoting") ? * return: * boolean. */ static int special(int ch) { switch (ch) { case 0x22: /* '"' */ case 0x2E: /* '.' */ case 0x3B: /* ';' */ case 0x5C: /* '\\' */ case 0x28: /* '(' */ case 0x29: /* ')' */ /* Special modifiers in zone files. */ case 0x40: /* '@' */ case 0x24: /* '$' */ return(1); default: return(0); } } /*2*/ static int labellen(const unsigned char *lp) { int bitlen; unsigned char l = *lp; if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) { /* should be avoided by the caller */ return(-1); } if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) { if (l == DNS_LABELTYPE_BITSTRING) { if ((bitlen = *(lp + 1)) == 0) bitlen = 256; return((bitlen + 7 ) / 8 + 1); } return(-1); /* unknwon ELT */ } return(l); } /*2*/ /* * printable(ch) * Thinking in noninternationalized USASCII (per the DNS spec), * is this character visible and not a space when printed ? * return: * boolean. */ static int printable(int ch) { return(ch > 0x20 && ch < 0x7f); } /*2*/ static int irc_decode_bitstring(const unsigned char **cpp, char *dn, const char *eom) { const unsigned char *cp = *cpp; char *beg = dn, tc; int b, blen, plen; if ((blen = (*cp & 0xff)) == 0) blen = 256; plen = (blen + 3) / 4; plen += sizeof("\\[x/]") + (blen > 99 ? 3 : (blen > 9) ? 2 : 1); if (dn + plen >= eom) return(-1); cp++; dn += sprintf(dn, "\\[x"); for (b = blen; b > 7; b -= 8, cp++) dn += sprintf(dn, "%02x", *cp & 0xff); if (b > 4) { tc = *cp++; dn += sprintf(dn, "%02x", tc & (0xff << (8 - b))); } else if (b > 0) { tc = *cp++; dn += sprintf(dn, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))); } dn += sprintf(dn, "/%d]", blen); *cpp = cp; return(dn - beg); } /*2*/ /* * irc_ns_name_pton(src, dst, dstsiz) * Convert a ascii string into an encoded domain name as per RFC1035. * return: * -1 if it fails * 1 if string was fully qualified * 0 is string was not fully qualified * notes: * Enforces label and domain length limits. */ static int irc_ns_name_pton(const char *src, unsigned char *dst, size_t dstsiz) { unsigned char *label, *bp, *eom; char *cp; int c, n, escaped, e = 0; escaped = 0; bp = dst; eom = dst + dstsiz; label = bp++; while ((c = *src++) != 0) { if (escaped) { if (c == '[') { /* start a bit string label */ if ((cp = strchr(src, ']')) == NULL) { errno = EINVAL; /* ??? */ return(-1); } if ((e = irc_encode_bitsring(&src, cp + 2, &label, &bp, eom)) != 0) { errno = e; return(-1); } escaped = 0; label = bp++; if ((c = *src++) == 0) goto done; else if (c != '.') { errno = EINVAL; return(-1); } continue; } else if ((cp = strchr(digits, c)) != NULL) { n = (cp - digits) * 100; if ((c = *src++) == 0 || (cp = strchr(digits, c)) == NULL) { errno = EMSGSIZE; return (-1); } n += (cp - digits) * 10; if ((c = *src++) == 0 || (cp = strchr(digits, c)) == NULL) { errno = EMSGSIZE; return (-1); } n += (cp - digits); if (n > 255) { errno = EMSGSIZE; return (-1); } c = n; } escaped = 0; } else if (c == '\\') { escaped = 1; continue; } else if (c == '.') { c = (bp - label - 1); if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ errno = EMSGSIZE; return (-1); } if (label >= eom) { errno = EMSGSIZE; return (-1); } *label = c; /* Fully qualified ? */ if (*src == '\0') { if (c != 0) { if (bp >= eom) { errno = EMSGSIZE; return (-1); } *bp++ = '\0'; } if ((bp - dst) > NS_MAXCDNAME) { errno = EMSGSIZE; return (-1); } return (1); } if (c == 0 || *src == '.') { errno = EMSGSIZE; return (-1); } label = bp++; continue; } if (bp >= eom) { errno = EMSGSIZE; return (-1); } *bp++ = (unsigned char)c; } c = (bp - label - 1); if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */ errno = EMSGSIZE; return (-1); } done: if (label >= eom) { errno = EMSGSIZE; return (-1); } *label = c; if (c != 0) { if (bp >= eom) { errno = EMSGSIZE; return (-1); } *bp++ = 0; } if ((bp - dst) > NS_MAXCDNAME) { /* src too big */ errno = EMSGSIZE; return (-1); } return (0); } /*2*/ /* * irc_ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr) * Pack domain name 'domain' into 'comp_dn'. * return: * Size of the compressed name, or -1. * notes: * 'dnptrs' is an array of pointers to previous compressed names. * dnptrs[0] is a pointer to the beginning of the message. The array * ends with NULL. * 'lastdnptr' is a pointer to the end of the array pointed to * by 'dnptrs'. * Side effects: * The list of pointers in dnptrs is updated for labels inserted into * the message as we compress the name. If 'dnptr' is NULL, we don't * try to compress names. If 'lastdnptr' is NULL, we don't update the * list. */ static int irc_ns_name_pack(const unsigned char *src, unsigned char *dst, int dstsiz, const unsigned char **dnptrs, const unsigned char **lastdnptr) { unsigned char *dstp; const unsigned char **cpp, **lpp, *eob, *msg; const unsigned char *srcp; int n, l, first = 1; srcp = src; dstp = dst; eob = dstp + dstsiz; lpp = cpp = NULL; if (dnptrs != NULL) { if ((msg = *dnptrs++) != NULL) { for (cpp = dnptrs; *cpp != NULL; cpp++) (void)NULL; lpp = cpp; /* end of list to search */ } } else msg = NULL; /* make sure the domain we are about to add is legal */ l = 0; do { int l0; n = *srcp; if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) { errno = EMSGSIZE; return (-1); } if ((l0 = labellen(srcp)) < 0) { errno = EINVAL; return(-1); } l += l0 + 1; if (l > NS_MAXCDNAME) { errno = EMSGSIZE; return (-1); } srcp += l0 + 1; } while (n != 0); /* from here on we need to reset compression pointer array on error */ srcp = src; do { /* Look to see if we can use pointers. */ n = *srcp; if (n != 0 && msg != NULL) { l = irc_dn_find(srcp, msg, (const unsigned char * const *)dnptrs, (const unsigned char * const *)lpp); if (l >= 0) { if (dstp + 1 >= eob) { goto cleanup; } *dstp++ = (l >> 8) | NS_CMPRSFLGS; *dstp++ = l % 256; return (dstp - dst); } /* Not found, save it. */ if (lastdnptr != NULL && cpp < lastdnptr - 1 && (dstp - msg) < 0x4000 && first) { *cpp++ = dstp; *cpp = NULL; first = 0; } } /* copy label to buffer */ if ((n & NS_CMPRSFLGS) == NS_CMPRSFLGS) { /* Should not happen. */ goto cleanup; } n = labellen(srcp); if (dstp + 1 + n >= eob) { goto cleanup; } memcpy(dstp, srcp, n + 1); srcp += n + 1; dstp += n + 1; } while (n != 0); if (dstp > eob) { cleanup: if (msg != NULL) *lpp = NULL; errno = EMSGSIZE; return (-1); } return(dstp - dst); } /*2*/ static int irc_ns_name_compress(const char *src, unsigned char *dst, size_t dstsiz, const unsigned char **dnptrs, const unsigned char **lastdnptr) { unsigned char tmp[NS_MAXCDNAME]; if (irc_ns_name_pton(src, tmp, sizeof tmp) == -1) return(-1); return(irc_ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr)); } static int irc_encode_bitsring(const char **bp, const char *end, unsigned char **labelp, unsigned char **dst, const unsigned char *eom) { int afterslash = 0; const char *cp = *bp; unsigned char *tp; char c; const char *beg_blen; char *end_blen = NULL; int value = 0, count = 0, tbcount = 0, blen = 0; beg_blen = end_blen = NULL; /* a bitstring must contain at least 2 characters */ if (end - cp < 2) return(EINVAL); /* XXX: currently, only hex strings are supported */ if (*cp++ != 'x') return(EINVAL); if (!isxdigit((*cp) & 0xff)) /* reject '\[x/BLEN]' */ return(EINVAL); for (tp = *dst + 1; cp < end && tp < eom; cp++) { switch((c = *cp)) { case ']': /* end of the bitstring */ if (afterslash) { if (beg_blen == NULL) return(EINVAL); blen = (int)strtol(beg_blen, &end_blen, 10); if (*end_blen != ']') return(EINVAL); } if (count) *tp++ = ((value << 4) & 0xff); cp++; /* skip ']' */ goto done; case '/': afterslash = 1; break; default: if (afterslash) { if (!isdigit(c&0xff)) return(EINVAL); if (beg_blen == NULL) { if (c == '0') { /* blen never begings with 0 */ return(EINVAL); } beg_blen = cp; } } else { if (!isxdigit(c&0xff)) return(EINVAL); value <<= 4; value += digitvalue[(int)c]; count += 4; tbcount += 4; if (tbcount > 256) return(EINVAL); if (count == 8) { *tp++ = value; count = 0; } } break; } } done: if (cp >= end || tp >= eom) return(EMSGSIZE); /* * bit length validation: * If a is present, the number of digits in the * MUST be just sufficient to contain the number of bits specified * by the . If there are insignificant bits in a final * hexadecimal or octal digit, they MUST be zero. * RFC 2673, Section 3.2. */ if (blen > 0) { int traillen; if (((blen + 3) & ~3) != tbcount) return(EINVAL); traillen = tbcount - blen; /* between 0 and 3 */ if (((value << (8 - traillen)) & 0xff) != 0) return(EINVAL); } else blen = tbcount; if (blen == 256) blen = 0; /* encode the type and the significant bit fields */ **labelp = DNS_LABELTYPE_BITSTRING; **dst = blen; *bp = cp; *dst = tp; return(0); } /*2*/ /* * dn_find(domain, msg, dnptrs, lastdnptr) * Search for the counted-label name in an array of compressed names. * return: * offset from msg if found, or -1. * notes: * dnptrs is the pointer to the first name on the list, * not the pointer to the start of the message. */ static int irc_dn_find(const unsigned char *domain, const unsigned char *msg, const unsigned char * const *dnptrs, const unsigned char * const *lastdnptr) { const unsigned char *dn, *cp, *sp; const unsigned char * const *cpp; unsigned int n; for (cpp = dnptrs; cpp < lastdnptr; cpp++) { sp = *cpp; /* * terminate search on: * root label * compression pointer * unusable offset */ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 && (sp - msg) < 0x4000) { dn = domain; cp = sp; while ((n = *cp++) != 0) { /* * check for indirection */ switch (n & NS_CMPRSFLGS) { case 0: /* normal case, n == len */ n = labellen(cp - 1); /* XXX */ if (n != *dn++) goto next; for ((void)NULL; n > 0; n--) if (mklower(*dn++) != mklower(*cp++)) goto next; /* Is next root for both ? */ if (*dn == '\0' && *cp == '\0') return (sp - msg); if (*dn) continue; goto next; case NS_CMPRSFLGS: /* indirection */ cp = msg + (((n & 0x3f) << 8) | *cp); break; default: /* illegal type */ errno = EMSGSIZE; return (-1); } } next: ; sp += *sp + 1; } } errno = ENOENT; return (-1); } /*2*/ /* * * Thinking in noninternationalized USASCII (per the DNS spec), * * convert this character to lower case if it's upper case. * */ static int mklower(int ch) { if (ch >= 0x41 && ch <= 0x5A) return(ch + 0x20); return(ch); } /*2*/ /* From resolv/mkquery.c */ /* * Form all types of queries. * Returns the size of the result or -1. */ int irc_res_mkquery( const char *dname, /* domain name */ int class, int type, /* class and type of query */ unsigned char *buf, /* buffer to put query */ int buflen) /* size of buffer */ { HEADER *hp; unsigned char *cp; int n; const unsigned char *dnptrs[20], **dpp, **lastdnptr; /* * Initialize header fields. */ if ((buf == NULL) || (buflen < HFIXEDSZ)) return (-1); memset(buf, 0, HFIXEDSZ); hp = (HEADER *) buf; hp->id = 0; hp->opcode = QUERY; hp->rd = 1; /* recurse */ hp->rcode = NO_ERRORS; cp = buf + HFIXEDSZ; buflen -= HFIXEDSZ; dpp = dnptrs; *dpp++ = buf; *dpp++ = NULL; lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0]; if ((buflen -= QFIXEDSZ) < 0) return (-1); if ((n = irc_ns_name_compress(dname, cp, buflen, dnptrs, lastdnptr)) < 0) return (-1); cp += n; buflen -= n; IRC_NS_PUT16(type, cp); IRC_NS_PUT16(class, cp); hp->qdcount = htons(1); return (cp - buf); } ircd-hybrid-8.1.13.dfsg.1/src/listener.c0000644000175000017500000002622412263053413015772 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * listener.c: Listens on a port. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: listener.c 2690 2013-12-17 18:55:43Z michael $ */ #include "stdinc.h" #include "list.h" #include "listener.h" #include "client.h" #include "fdlist.h" #include "irc_string.h" #include "ircd.h" #include "ircd_defs.h" #include "s_bsd.h" #include "numeric.h" #include "conf.h" #include "send.h" #include "memory.h" static PF accept_connection; static dlink_list ListenerPollList = { NULL, NULL, 0 }; static void close_listener(struct Listener *listener); static struct Listener * make_listener(int port, struct irc_ssaddr *addr) { struct Listener *listener = MyMalloc(sizeof(struct Listener)); listener->port = port; memcpy(&listener->addr, addr, sizeof(struct irc_ssaddr)); return listener; } void free_listener(struct Listener *listener) { assert(listener != NULL); dlinkDelete(&listener->node, &ListenerPollList); MyFree(listener); } /* * get_listener_name - return displayable listener name and port * returns "host.foo.org/6667" for a given listener */ const char * get_listener_name(const struct Listener *const listener) { static char buf[HOSTLEN + HOSTLEN + PORTNAMELEN + 4]; snprintf(buf, sizeof(buf), "%s[%s/%u]", me.name, listener->name, listener->port); return buf; } /* show_ports() * * inputs - pointer to client to show ports to * output - none * side effects - send port listing to a client */ void show_ports(struct Client *source_p) { char buf[IRCD_BUFSIZE]; char *p = NULL; dlink_node *ptr; DLINK_FOREACH(ptr, ListenerPollList.head) { const struct Listener *listener = ptr->data; p = buf; if (listener->flags & LISTENER_HIDDEN) { if (!HasUMode(source_p, UMODE_ADMIN)) continue; *p++ = 'H'; } if (listener->flags & LISTENER_SERVER) *p++ = 'S'; if (listener->flags & LISTENER_SSL) *p++ = 's'; *p = '\0'; if (HasUMode(source_p, UMODE_ADMIN) && (MyClient(source_p) || !ConfigServerHide.hide_server_ips)) sendto_one(source_p, form_str(RPL_STATSPLINE), me.name, source_p->name, 'P', listener->port, listener->name, listener->ref_count, buf, listener->active ? "active" : "disabled"); else sendto_one(source_p, form_str(RPL_STATSPLINE), me.name, source_p->name, 'P', listener->port, me.name, listener->ref_count, buf, listener->active ? "active" : "disabled"); } } /* * inetport - create a listener socket in the AF_INET or AF_INET6 domain, * bind it to the port given in 'port' and listen to it * returns true (1) if successful false (0) on error. * * If the operating system has a define for SOMAXCONN, use it, otherwise * use HYBRID_SOMAXCONN */ #ifdef SOMAXCONN #undef HYBRID_SOMAXCONN #define HYBRID_SOMAXCONN SOMAXCONN #endif static int inetport(struct Listener *listener) { struct irc_ssaddr lsin; socklen_t opt = 1; memset(&lsin, 0, sizeof(lsin)); memcpy(&lsin, &listener->addr, sizeof(lsin)); getnameinfo((struct sockaddr *)&lsin, lsin.ss_len, listener->name, sizeof(listener->name), NULL, 0, NI_NUMERICHOST); /* * At first, open a new socket */ if (comm_open(&listener->fd, listener->addr.ss.ss_family, SOCK_STREAM, 0, "Listener socket") == -1) { report_error(L_ALL, "opening listener socket %s:%s", get_listener_name(listener), errno); return 0; } if (setsockopt(listener->fd.fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt))) { report_error(L_ALL, "setting SO_REUSEADDR for listener %s:%s", get_listener_name(listener), errno); fd_close(&listener->fd); return 0; } /* * Bind a port to listen for new connections if port is non-null, * else assume it is already open and try get something from it. */ lsin.ss_port = htons(listener->port); if (bind(listener->fd.fd, (struct sockaddr *)&lsin, lsin.ss_len)) { report_error(L_ALL, "binding listener socket %s:%s", get_listener_name(listener), errno); fd_close(&listener->fd); return 0; } if (listen(listener->fd.fd, HYBRID_SOMAXCONN)) { report_error(L_ALL, "listen failed for %s:%s", get_listener_name(listener), errno); fd_close(&listener->fd); return 0; } /* Listen completion events are READ events .. */ accept_connection(&listener->fd, listener); return 1; } static struct Listener * find_listener(int port, struct irc_ssaddr *addr) { dlink_node *ptr; struct Listener *listener = NULL; struct Listener *last_closed = NULL; DLINK_FOREACH(ptr, ListenerPollList.head) { listener = ptr->data; if ((port == listener->port) && (!memcmp(addr, &listener->addr, sizeof(struct irc_ssaddr)))) { /* Try to return an open listener, otherwise reuse a closed one */ if (!listener->fd.flags.open) last_closed = listener; else return (listener); } } return (last_closed); } /* * add_listener- create a new listener * port - the port number to listen on * vhost_ip - if non-null must contain a valid IP address string in * the format "255.255.255.255" */ void add_listener(int port, const char *vhost_ip, unsigned int flags) { struct Listener *listener; struct irc_ssaddr vaddr; struct addrinfo hints, *res; char portname[PORTNAMELEN + 1]; #ifdef IPV6 static short int pass = 0; /* if ipv6 and no address specified we need to have two listeners; one for each protocol. */ #endif /* * if no or invalid port in conf line, don't bother */ if (!(port > 0 && port <= 0xFFFF)) return; memset(&vaddr, 0, sizeof(vaddr)); /* Set up the hints structure */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; /* Get us ready for a bind() and don't bother doing dns lookup */ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; #ifdef IPV6 if (ServerInfo.can_use_v6) { snprintf(portname, sizeof(portname), "%d", port); getaddrinfo("::", portname, &hints, &res); vaddr.ss.ss_family = AF_INET6; assert(res != NULL); memcpy((struct sockaddr*)&vaddr, res->ai_addr, res->ai_addrlen); vaddr.ss_port = port; vaddr.ss_len = res->ai_addrlen; freeaddrinfo(res); } else #endif { struct sockaddr_in *v4 = (struct sockaddr_in*) &vaddr; v4->sin_addr.s_addr = INADDR_ANY; vaddr.ss.ss_family = AF_INET; vaddr.ss_len = sizeof(struct sockaddr_in); v4->sin_port = htons(port); } snprintf(portname, PORTNAMELEN, "%d", port); if (!EmptyString(vhost_ip)) { if (getaddrinfo(vhost_ip, portname, &hints, &res)) return; assert(res != NULL); memcpy((struct sockaddr*)&vaddr, res->ai_addr, res->ai_addrlen); vaddr.ss_port = port; vaddr.ss_len = res->ai_addrlen; freeaddrinfo(res); } #ifdef IPV6 else if (pass == 0 && ServerInfo.can_use_v6) { /* add the ipv4 listener if we havent already */ pass = 1; add_listener(port, "0.0.0.0", flags); } pass = 0; #endif if ((listener = find_listener(port, &vaddr))) { listener->flags = flags; if (listener->fd.flags.open) return; } else { listener = make_listener(port, &vaddr); dlinkAdd(listener, &listener->node, &ListenerPollList); listener->flags = flags; } if (inetport(listener)) listener->active = 1; else close_listener(listener); } /* * close_listener - close a single listener */ static void close_listener(struct Listener *listener) { assert(listener != NULL); if (listener == NULL) return; if (listener->fd.flags.open) fd_close(&listener->fd); listener->active = 0; if (listener->ref_count) return; free_listener(listener); } /* * close_listeners - close and free all listeners that are not being used */ void close_listeners(void) { dlink_node *ptr = NULL, *next_ptr = NULL; /* close all 'extra' listening ports we have */ DLINK_FOREACH_SAFE(ptr, next_ptr, ListenerPollList.head) close_listener(ptr->data); } #define TOOFAST_WARNING "ERROR :Trying to reconnect too fast.\r\n" #define DLINE_WARNING "ERROR :You have been D-lined.\r\n" static void accept_connection(fde_t *pfd, void *data) { static time_t last_oper_notice = 0; struct irc_ssaddr addr; int fd; int pe; struct Listener *listener = data; memset(&addr, 0, sizeof(addr)); assert(listener != NULL); /* There may be many reasons for error return, but * in otherwise correctly working environment the * probable cause is running out of file descriptors * (EMFILE, ENFILE or others?). The man pages for * accept don't seem to list these as possible, * although it's obvious that it may happen here. * Thus no specific errors are tested at this * point, just assume that connections cannot * be accepted until some old is closed first. */ while ((fd = comm_accept(listener, &addr)) != -1) { /* * check for connection limit */ if (number_fd > hard_fdlimit - 10) { ++ServerStats.is_ref; /* * slow down the whining to opers bit */ if ((last_oper_notice + 20) <= CurrentTime) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "All connections in use. (%s)", get_listener_name(listener)); last_oper_notice = CurrentTime; } if (!(listener->flags & LISTENER_SSL)) send(fd, "ERROR :All connections in use\r\n", 32, 0); close(fd); break; /* jump out and re-register a new io request */ } /* * Do an initial check we aren't connecting too fast or with too many * from this IP... */ if ((pe = conf_connect_allowed(&addr, addr.ss.ss_family)) != 0) { ++ServerStats.is_ref; if (!(listener->flags & LISTENER_SSL)) switch (pe) { case BANNED_CLIENT: send(fd, DLINE_WARNING, sizeof(DLINE_WARNING)-1, 0); break; case TOO_FAST: send(fd, TOOFAST_WARNING, sizeof(TOOFAST_WARNING)-1, 0); break; } close(fd); continue; /* drop the one and keep on clearing the queue */ } ++ServerStats.is_ac; add_connection(listener, &addr, fd); } /* Re-register a new IO request for the next accept .. */ comm_setselect(&listener->fd, COMM_SELECT_READ, accept_connection, listener, 0); } ircd-hybrid-8.1.13.dfsg.1/src/Makefile.am0000644000175000017500000000362712263053413016037 0ustar domdomAUTOMAKE_OPTIONS = foreign sbin_PROGRAMS = ircd AM_YFLAGS = -d AM_CPPFLAGS = $(LTDLINCL) -I$(top_srcdir)/include ircd_LDFLAGS = -export-dynamic ircd_LDADD = $(LIBLTDL) ircd_DEPENDENCIES = $(LTDLDEPS) ircd_SOURCES = channel.c \ channel_mode.c \ client.c \ conf.c \ conf_class.c \ conf_db.c \ conf_parser.y \ conf_lexer.l \ dbuf.c \ event.c \ fdlist.c \ getopt.c \ hash.c \ hook.c \ hostmask.c \ irc_res.c \ irc_reslib.c \ irc_string.c \ ircd.c \ ircd_signal.c \ list.c \ listener.c \ log.c \ match.c \ memory.c \ mempool.c \ modules.c \ motd.c \ rng_mt.c \ numeric.c \ packet.c \ parse.c \ s_bsd_epoll.c \ s_bsd_poll.c \ s_bsd_devpoll.c \ s_bsd_kqueue.c \ s_bsd_select.c \ restart.c \ resv.c \ rsa.c \ s_auth.c \ s_bsd.c \ s_gline.c \ s_misc.c \ s_serv.c \ s_user.c \ send.c \ version.c \ watch.c \ whowas.c ircd-hybrid-8.1.13.dfsg.1/src/s_user.c0000644000175000017500000012012212263053413015435 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_user.c: User related functions. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_user.c 2690 2013-12-17 18:55:43Z michael $ */ #include "stdinc.h" #include "list.h" #include "s_user.h" #include "s_misc.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "fdlist.h" #include "hash.h" #include "irc_string.h" #include "s_bsd.h" #include "ircd.h" #include "listener.h" #include "motd.h" #include "numeric.h" #include "conf.h" #include "log.h" #include "s_serv.h" #include "send.h" #include "supported.h" #include "whowas.h" #include "memory.h" #include "packet.h" #include "rng_mt.h" #include "userhost.h" #include "hook.h" #include "s_misc.h" #include "parse.h" #include "watch.h" static char umode_buffer[IRCD_BUFSIZE]; static void user_welcome(struct Client *); static void report_and_set_user_flags(struct Client *, const struct MaskItem *); static int check_xline(struct Client *); static void introduce_client(struct Client *); static const char *uid_get(void); /* Used for building up the isupport string, * used with init_isupport, add_isupport, delete_isupport */ struct Isupport { dlink_node node; char *name; char *options; int number; }; static dlink_list support_list; static dlink_list support_list_lines; /* memory is cheap. map 0-255 to equivalent mode */ const unsigned int user_modes[256] = { /* 0x00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x0F */ /* 0x10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x1F */ /* 0x20 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x2F */ /* 0x30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x3F */ 0, /* @ */ 0, /* A */ 0, /* B */ 0, /* C */ UMODE_DEAF, /* D */ 0, /* E */ UMODE_FARCONNECT, /* F */ UMODE_SOFTCALLERID, /* G */ UMODE_HIDDEN, /* H */ 0, /* I */ 0, /* J */ 0, /* K */ 0, /* L */ 0, /* M */ 0, /* N */ 0, /* O */ 0, /* P */ 0, /* Q */ UMODE_REGONLY, /* R */ UMODE_SSL, /* S */ 0, /* T */ 0, /* U */ 0, /* V */ UMODE_WEBIRC, /* W */ 0, /* X */ 0, /* Y */ 0, /* Z 0x5A */ 0, 0, 0, 0, 0, /* 0x5F */ 0, /* 0x60 */ UMODE_ADMIN, /* a */ UMODE_BOTS, /* b */ UMODE_CCONN, /* c */ UMODE_DEBUG, /* d */ UMODE_EXTERNAL, /* e */ UMODE_FULL, /* f */ UMODE_CALLERID, /* g */ 0, /* h */ UMODE_INVISIBLE, /* i */ UMODE_REJ, /* j */ UMODE_SKILL, /* k */ UMODE_LOCOPS, /* l */ 0, /* m */ UMODE_NCHANGE, /* n */ UMODE_OPER, /* o */ 0, /* p */ 0, /* q */ UMODE_REGISTERED, /* r */ UMODE_SERVNOTICE, /* s */ 0, /* t */ UMODE_UNAUTH, /* u */ 0, /* v */ UMODE_WALLOP, /* w */ UMODE_HIDDENHOST, /* x */ UMODE_SPY, /* y */ UMODE_OPERWALL, /* z 0x7A */ 0,0,0,0,0, /* 0x7B - 0x7F */ /* 0x80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x8F */ /* 0x90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x9F */ /* 0xA0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xAF */ /* 0xB0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xBF */ /* 0xC0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xCF */ /* 0xD0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xDF */ /* 0xE0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xEF */ /* 0xF0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xFF */ }; void assemble_umode_buffer(void) { unsigned int idx = 0; char *umode_buffer_ptr = umode_buffer; for (; idx < (sizeof(user_modes) / sizeof(user_modes[0])); ++idx) if (user_modes[idx]) *umode_buffer_ptr++ = idx; *umode_buffer_ptr = '\0'; } /* show_lusers() * * inputs - pointer to client * output - NONE * side effects - display to client user counts etc. */ void show_lusers(struct Client *source_p) { const char *from, *to; if (!MyConnect(source_p) && IsCapable(source_p->from, CAP_TS6) && HasID(source_p)) { from = me.id; to = source_p->id; } else { from = me.name; to = source_p->name; } if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) sendto_one(source_p, form_str(RPL_LUSERCLIENT), from, to, (Count.total-Count.invisi), Count.invisi, dlink_list_length(&global_serv_list)); else sendto_one(source_p, form_str(RPL_LUSERCLIENT), from, to, (Count.total-Count.invisi), Count.invisi, 1); if (Count.oper > 0) sendto_one(source_p, form_str(RPL_LUSEROP), from, to, Count.oper); if (dlink_list_length(&unknown_list) > 0) sendto_one(source_p, form_str(RPL_LUSERUNKNOWN), from, to, dlink_list_length(&unknown_list)); if (dlink_list_length(&global_channel_list) > 0) sendto_one(source_p, form_str(RPL_LUSERCHANNELS), from, to, dlink_list_length(&global_channel_list)); if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) { sendto_one(source_p, form_str(RPL_LUSERME), from, to, Count.local, Count.myserver); sendto_one(source_p, form_str(RPL_LOCALUSERS), from, to, Count.local, Count.max_loc); } else { sendto_one(source_p, form_str(RPL_LUSERME), from, to, Count.total, 0); sendto_one(source_p, form_str(RPL_LOCALUSERS), from, to, Count.total, Count.max_tot); } sendto_one(source_p, form_str(RPL_GLOBALUSERS), from, to, Count.total, Count.max_tot); if (!ConfigServerHide.hide_servers || HasUMode(source_p, UMODE_OPER)) sendto_one(source_p, form_str(RPL_STATSCONN), from, to, Count.max_loc_con, Count.max_loc_cli, Count.totalrestartcount); if (Count.local > Count.max_loc_cli) Count.max_loc_cli = Count.local; if ((Count.local + Count.myserver) > Count.max_loc_con) Count.max_loc_con = Count.local + Count.myserver; } /* show_isupport() * * inputs - pointer to client * output - NONE * side effects - display to client what we support (for them) */ void show_isupport(struct Client *source_p) { const dlink_node *ptr = NULL; DLINK_FOREACH(ptr, support_list_lines.head) sendto_one(source_p, form_str(RPL_ISUPPORT), me.name, source_p->name, ptr->data); } /* ** register_local_user ** This function is called when both NICK and USER messages ** have been accepted for the client, in whatever order. Only ** after this, is the USER message propagated. ** ** NICK's must be propagated at once when received, although ** it would be better to delay them too until full info is ** available. Doing it is not so simple though, would have ** to implement the following: ** ** (actually it has been implemented already for a while) -orabidoo ** ** 1) user telnets in and gives only "NICK foobar" and waits ** 2) another user far away logs in normally with the nick ** "foobar" (quite legal, as this server didn't propagate ** it). ** 3) now this server gets nick "foobar" from outside, but ** has alread the same defined locally. Current server ** would just issue "KILL foobar" to clean out dups. But, ** this is not fair. It should actually request another ** nick from local user or kill him/her... */ void register_local_user(struct Client *source_p) { const char *id = NULL; const struct MaskItem *conf = NULL; assert(source_p != NULL); assert(source_p == source_p->from); assert(MyConnect(source_p)); assert(!source_p->localClient->registration); ClearCap(source_p, CAP_TS6); if (ConfigFileEntry.ping_cookie) { if (!IsPingSent(source_p) && !source_p->localClient->random_ping) { do source_p->localClient->random_ping = genrand_int32(); while (!source_p->localClient->random_ping); sendto_one(source_p, "PING :%u", source_p->localClient->random_ping); SetPingSent(source_p); return; } if (!HasPingCookie(source_p)) return; } source_p->localClient->last_privmsg = CurrentTime; /* Straight up the maximum rate of flooding... */ source_p->localClient->allow_read = MAX_FLOOD_BURST; if (!check_client(source_p)) return; if (!valid_hostname(source_p->host)) { sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You have an illegal " "character in your hostname", me.name, source_p->name); strlcpy(source_p->host, source_p->sockhost, sizeof(source_p->host)); } conf = source_p->localClient->confs.head->data; if (!IsGotId(source_p)) { char username[USERLEN + 1]; const char *p = username; unsigned int i = 0; if (IsNeedIdentd(conf)) { ++ServerStats.is_ref; sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You need to install " "identd to use this server", me.name, source_p->name); exit_client(source_p, &me, "Install identd"); return; } strlcpy(username, source_p->username, sizeof(username)); if (!IsNoTilde(conf)) source_p->username[i++] = '~'; for (; *p && i < USERLEN; ++p) if (*p != '[') source_p->username[i++] = *p; source_p->username[i] = '\0'; } /* password check */ if (!EmptyString(conf->passwd)) { const char *pass = source_p->localClient->passwd; if (!match_conf_password(pass, conf)) { ++ServerStats.is_ref; sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name); exit_client(source_p, &me, "Bad Password"); return; } } /* don't free source_p->localClient->passwd here - it can be required * by masked /stats I if there are auth{} blocks with need_password = no; * --adx */ /* report if user has &^>= etc. and set flags as needed in source_p */ report_and_set_user_flags(source_p, conf); if (IsDead(source_p)) return; /* Limit clients - * We want to be able to have servers and F-line clients * connect, so save room for "buffer" connections. * Smaller servers may want to decrease this, and it should * probably be just a percentage of the MAXCLIENTS... * -Taner */ /* Except "F:" clients */ if ((Count.local >= ServerInfo.max_clients + MAX_BUFFER) || (Count.local >= ServerInfo.max_clients && !IsExemptLimits(source_p))) { sendto_realops_flags(UMODE_FULL, L_ALL, SEND_NOTICE, "Too many clients, rejecting %s[%s].", source_p->name, source_p->host); ++ServerStats.is_ref; exit_client(source_p, &me, "Sorry, server is full - try later"); return; } /* valid user name check */ if (!valid_username(source_p->username, 1)) { char tmpstr2[IRCD_BUFSIZE]; sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "Invalid username: %s (%s@%s)", source_p->name, source_p->username, source_p->host); ++ServerStats.is_ref; snprintf(tmpstr2, sizeof(tmpstr2), "Invalid username [%s]", source_p->username); exit_client(source_p, &me, tmpstr2); return; } if (check_xline(source_p)) return; while (hash_find_id((id = uid_get())) != NULL) ; strlcpy(source_p->id, id, sizeof(source_p->id)); hash_add_id(source_p); sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE, "Client connecting: %s (%s@%s) [%s] {%s} [%s] <%s>", source_p->name, source_p->username, source_p->host, ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost, get_client_class(&source_p->localClient->confs), source_p->info, source_p->id); if (ConfigFileEntry.invisible_on_connect) { AddUMode(source_p, UMODE_INVISIBLE); ++Count.invisi; } if (++Count.local > Count.max_loc) { Count.max_loc = Count.local; if (!(Count.max_loc % 10)) sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "New Max Local Clients: %d", Count.max_loc); } /* Increment our total user count here */ if (++Count.total > Count.max_tot) Count.max_tot = Count.total; ++Count.totalrestartcount; assert(source_p->servptr == &me); SetClient(source_p); dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); source_p->localClient->allow_read = MAX_FLOOD_BURST; assert(dlinkFind(&unknown_list, source_p)); dlink_move_node(&source_p->localClient->lclient_node, &unknown_list, &local_client_list); user_welcome(source_p); add_user_host(source_p->username, source_p->host, 0); SetUserHost(source_p); introduce_client(source_p); } /* register_remote_user() * * inputs - source_p remote or directly connected client * - username to register as * - host name to register as * - server name * - realname (gecos) * output - NONE * side effects - This function is called when a remote client * is introduced by a server. */ void register_remote_user(struct Client *source_p, const char *username, const char *host, const char *server, const char *realname) { struct Client *target_p = NULL; assert(source_p != NULL); assert(source_p->username != username); strlcpy(source_p->host, host, sizeof(source_p->host)); strlcpy(source_p->username, username, sizeof(source_p->username)); /* * coming from another server, take the servers word for it */ source_p->servptr = hash_find_server(server); /* * Super GhostDetect: * If we can't find the server the user is supposed to be on, * then simply blow the user away. -Taner */ if (source_p->servptr == NULL) { sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "No server %s for user %s[%s@%s] from %s", server, source_p->name, source_p->username, source_p->host, source_p->from->name); kill_client(source_p->from, source_p, "%s (Server doesn't exist)", me.name); AddFlag(source_p, FLAGS_KILLED); exit_client(source_p, &me, "Ghosted Client"); return; } if ((target_p = source_p->servptr) && target_p->from != source_p->from) { sendto_realops_flags(UMODE_DEBUG, L_ALL, SEND_NOTICE, "Bad User [%s] :%s USER %s@%s %s, != %s[%s]", source_p->from->name, source_p->name, source_p->username, source_p->host, source_p->servptr->name, target_p->name, target_p->from->name); kill_client(source_p->from, source_p, "%s (NICK from wrong direction (%s != %s))", me.name, source_p->servptr->name, target_p->from->name); AddFlag(source_p, FLAGS_KILLED); exit_client(source_p, &me, "USER server wrong direction"); return; } /* * If the nick has been introduced by a services server, * make it a service as well. */ if (HasFlag(source_p->servptr, FLAGS_SERVICE)) AddFlag(source_p, FLAGS_SERVICE); /* Increment our total user count here */ if (++Count.total > Count.max_tot) Count.max_tot = Count.total; SetClient(source_p); dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->client_list); add_user_host(source_p->username, source_p->host, 1); SetUserHost(source_p); if (HasFlag(source_p->servptr, FLAGS_EOB)) sendto_realops_flags(UMODE_FARCONNECT, L_ALL, SEND_NOTICE, "Client connecting at %s: %s (%s@%s) [%s] <%s>", source_p->servptr->name, source_p->name, source_p->username, source_p->host, source_p->info, source_p->id); introduce_client(source_p); } /* introduce_client() * * inputs - source_p * output - NONE * side effects - This common function introduces a client to the rest * of the net, either from a local client connect or * from a remote connect. */ static void introduce_client(struct Client *source_p) { dlink_node *server_node = NULL; char ubuf[IRCD_BUFSIZE]; if (MyClient(source_p)) send_umode(source_p, source_p, 0, SEND_UMODES, ubuf); else send_umode(NULL, source_p, 0, SEND_UMODES, ubuf); watch_check_hash(source_p, RPL_LOGON); if (ubuf[0] == '\0') { ubuf[0] = '+'; ubuf[1] = '\0'; } DLINK_FOREACH(server_node, serv_list.head) { struct Client *server = server_node->data; if (server == source_p->from) continue; if (IsCapable(server, CAP_SVS)) { if (IsCapable(server, CAP_TS6) && HasID(source_p)) sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s %s :%s", source_p->servptr->id, source_p->name, source_p->hopcount+1, (unsigned long)source_p->tsinfo, ubuf, source_p->username, source_p->host, (MyClient(source_p) && IsIPSpoof(source_p)) ? "0" : source_p->sockhost, source_p->id, source_p->svid, source_p->info); else sendto_one(server, "NICK %s %d %lu %s %s %s %s %s :%s", source_p->name, source_p->hopcount+1, (unsigned long)source_p->tsinfo, ubuf, source_p->username, source_p->host, source_p->servptr->name, source_p->svid, source_p->info); } else { if (IsCapable(server, CAP_TS6) && HasID(source_p)) sendto_one(server, ":%s UID %s %d %lu %s %s %s %s %s :%s", source_p->servptr->id, source_p->name, source_p->hopcount+1, (unsigned long)source_p->tsinfo, ubuf, source_p->username, source_p->host, (MyClient(source_p) && IsIPSpoof(source_p)) ? "0" : source_p->sockhost, source_p->id, source_p->info); else sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s", source_p->name, source_p->hopcount+1, (unsigned long)source_p->tsinfo, ubuf, source_p->username, source_p->host, source_p->servptr->name, source_p->info); } if (!EmptyString(source_p->certfp)) sendto_one(server, ":%s CERTFP %s", ID(source_p), source_p->certfp); } } /* valid_hostname() * * Inputs - pointer to hostname * Output - 1 if valid, 0 if not * Side effects - check hostname for validity * * NOTE: this doesn't allow a hostname to begin with a dot and * will not allow more dots than chars. */ int valid_hostname(const char *hostname) { const char *p = hostname; assert(p != NULL); if (EmptyString(p) || *p == '.' || *p == ':') return 0; for (; *p; ++p) if (!IsHostChar(*p)) return 0; return p - hostname <= HOSTLEN; } /* valid_username() * * Inputs - pointer to user * Output - 1 if valid, 0 if not * Side effects - check username for validity * * Absolutely always reject any '*' '!' '?' '@' in an user name * reject any odd control characters names. * Allow '.' in username to allow for "first.last" * style of username */ int valid_username(const char *username, const int local) { int dots = 0; const char *p = username; assert(p != NULL); if (*p == '~') ++p; /* * Reject usernames that don't start with an alphanum * i.e. reject jokers who have '-@somehost' or '.@somehost' * or "-hi-@somehost", "h-----@somehost" would still be accepted. */ if (!IsAlNum(*p)) return 0; if (local) { while (*++p) { if ((*p == '.') && ConfigFileEntry.dots_in_ident) { if (++dots > ConfigFileEntry.dots_in_ident) return 0; if (!IsUserChar(*(p + 1))) return 0; } else if (!IsUserChar(*p)) return 0; } } else { while (*++p) if (!IsUserChar(*p)) return 0; } return p - username <= USERLEN;; } /* clean_nick_name() * * input - nickname * - whether it's a local nick (1) or remote (0) * output - none * side effects - walks through the nickname, returning 0 if erroneous */ int valid_nickname(const char *nickname, const int local) { const char *p = nickname; assert(nickname && *nickname); /* nicks can't start with a digit or - or be 0 length */ /* This closer duplicates behaviour of hybrid-6 */ if (*p == '-' || (IsDigit(*p) && local) || *p == '\0') return 0; for (; *p; ++p) if (!IsNickChar(*p)) return 0; return p - nickname <= NICKLEN; } /* report_and_set_user_flags() * * inputs - pointer to source_p * - pointer to conf for this user * output - NONE * side effects - Report to user any special flags * they are getting, and set them. */ static void report_and_set_user_flags(struct Client *source_p, const struct MaskItem *conf) { /* If this user is being spoofed, tell them so */ if (IsConfDoSpoofIp(conf)) sendto_one(source_p, ":%s NOTICE %s :*** Spoofing your IP. Congrats.", me.name, source_p->name); /* If this user is in the exception class, Set it "E lined" */ if (IsConfExemptKline(conf)) { SetExemptKline(source_p); sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from K/D/G lines. Congrats.", me.name, source_p->name); } /* * The else here is to make sure that G line exempt users * do not get noticed twice. */ else if (IsConfExemptGline(conf)) { SetExemptGline(source_p); sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from G lines. Congrats.", me.name, source_p->name); } if (IsConfExemptResv(conf)) { SetExemptResv(source_p); sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from resvs. Congrats.", me.name, source_p->name); } /* If this user is exempt from user limits set it "F lined" */ if (IsConfExemptLimits(conf)) { SetExemptLimits(source_p); sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from user limits. Congrats.", me.name,source_p->name); } if (IsConfCanFlood(conf)) { SetCanFlood(source_p); sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from flood " "protection, aren't you fearsome.", me.name, source_p->name); } } /* set_user_mode() * * added 15/10/91 By Darren Reed. * parv[0] - sender * parv[1] - username to change mode for * parv[2] - modes to change */ void set_user_mode(struct Client *client_p, struct Client *source_p, const int parc, char *parv[]) { unsigned int flag, setflags; char **p, *m, buf[IRCD_BUFSIZE]; struct Client *target_p; int what = MODE_ADD, badflag = 0, i; assert(!(parc < 2)); if ((target_p = find_person(client_p, parv[1])) == NULL) { if (MyConnect(source_p)) sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, parv[1]); return; } if (source_p != target_p) { sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, source_p->name); return; } if (parc < 3) { m = buf; *m++ = '+'; for (i = 0; i < 128; ++i) if (HasUMode(source_p, user_modes[i])) *m++ = (char)i; *m = '\0'; sendto_one(source_p, form_str(RPL_UMODEIS), me.name, source_p->name, buf); return; } /* find flags already set for user */ setflags = source_p->umodes; /* parse mode change string(s) */ for (p = &parv[2]; p && *p; ++p) { for (m = *p; *m; ++m) { switch (*m) { case '+': what = MODE_ADD; break; case '-': what = MODE_DEL; break; case 'o': if (what == MODE_ADD) { if (IsServer(client_p) && !HasUMode(source_p, UMODE_OPER)) { ++Count.oper; SetOper(source_p); } } else { if (!HasUMode(source_p, UMODE_OPER)) break; ClearOper(source_p); Count.oper--; if (MyConnect(source_p)) { dlink_node *dm = NULL; detach_conf(source_p, CONF_OPER); ClrOFlag(source_p); DelUMode(source_p, ConfigFileEntry.oper_only_umodes); if ((dm = dlinkFindDelete(&oper_list, source_p)) != NULL) free_dlink_node(dm); } } break; case 'S': /* Only servers may set +S in a burst */ case 'W': /* Only servers may set +W in a burst */ case 'r': /* Only services may set +r */ case 'x': /* Only services may set +x */ break; default: if ((flag = user_modes[(unsigned char)*m])) { if (MyConnect(source_p) && !HasUMode(source_p, UMODE_OPER) && (ConfigFileEntry.oper_only_umodes & flag)) badflag = 1; else { if (what == MODE_ADD) AddUMode(source_p, flag); else DelUMode(source_p, flag); } } else if (MyConnect(source_p)) badflag = 1; break; } } } if (badflag) sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, source_p->name); if (MyConnect(source_p) && HasUMode(source_p, UMODE_ADMIN) && !HasOFlag(source_p, OPER_FLAG_ADMIN)) { sendto_one(source_p, ":%s NOTICE %s :*** You have no admin flag;", me.name, source_p->name); DelUMode(source_p, UMODE_ADMIN); } if (!(setflags & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE)) ++Count.invisi; if ((setflags & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE)) --Count.invisi; /* * compare new flags with old flags and send string which * will cause servers to update correctly. */ send_umode_out(client_p, source_p, setflags); } /* send_umode() * send the MODE string for user (user) to connection client_p * -avalon * * inputs - client_p * - source_p * - int old * - sendmask mask of modes to send * - suplied umode_buf * output - NONE */ void send_umode(struct Client *client_p, struct Client *source_p, unsigned int old, unsigned int sendmask, char *umode_buf) { char *m = umode_buf; int what = 0; unsigned int i; unsigned int flag; /* * build a string in umode_buf to represent the change in the user's * mode between the new (source_p->umodes) and 'old'. */ for (i = 0; i < 128; ++i) { flag = user_modes[i]; if (!flag) continue; if (MyClient(source_p) && !(flag & sendmask)) continue; if ((flag & old) && !HasUMode(source_p, flag)) { if (what == MODE_DEL) *m++ = (char)i; else { what = MODE_DEL; *m++ = '-'; *m++ = (char)i; } } else if (!(flag & old) && HasUMode(source_p, flag)) { if (what == MODE_ADD) *m++ = (char)i; else { what = MODE_ADD; *m++ = '+'; *m++ = (char)i; } } } *m = '\0'; if (*umode_buf && client_p) sendto_one(client_p, ":%s!%s@%s MODE %s :%s", source_p->name, source_p->username, source_p->host, source_p->name, umode_buf); } /* send_umode_out() * * inputs - * output - NONE * side effects - Only send ubuf out to servers that know about this client */ void send_umode_out(struct Client *client_p, struct Client *source_p, unsigned int old) { char buf[IRCD_BUFSIZE] = { '\0' }; dlink_node *ptr = NULL; send_umode(NULL, source_p, old, SEND_UMODES, buf); if (buf[0]) { DLINK_FOREACH(ptr, serv_list.head) { struct Client *target_p = ptr->data; if ((target_p != client_p) && (target_p != source_p)) sendto_one(target_p, ":%s MODE %s :%s", ID_or_name(source_p, target_p), ID_or_name(source_p, target_p), buf); } } if (client_p && MyClient(client_p)) send_umode(client_p, source_p, old, 0xffffffff, buf); } void user_set_hostmask(struct Client *target_p, const char *hostname, const int what) { dlink_node *ptr = NULL; if (!strcmp(target_p->host, hostname)) return; switch (what) { case MODE_ADD: AddUMode(target_p, UMODE_HIDDENHOST); AddFlag(target_p, FLAGS_IP_SPOOFING); break; case MODE_DEL: DelUMode(target_p, UMODE_HIDDENHOST); if (!HasFlag(target_p, FLAGS_AUTH_SPOOF)) DelFlag(target_p, FLAGS_IP_SPOOFING); break; default: return; } if (ConfigFileEntry.cycle_on_host_change) sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname", target_p->name, target_p->username, target_p->host); if (IsUserHostIp(target_p)) delete_user_host(target_p->username, target_p->host, !MyConnect(target_p)); strlcpy(target_p->host, hostname, sizeof(target_p->host)); add_user_host(target_p->username, target_p->host, !MyConnect(target_p)); SetUserHost(target_p); if (MyClient(target_p)) { sendto_one(target_p, form_str(RPL_NEWHOSTIS), me.name, target_p->name, target_p->host); clear_ban_cache_client(target_p); } if (!ConfigFileEntry.cycle_on_host_change) return; DLINK_FOREACH(ptr, target_p->channel.head) { char modebuf[4], nickbuf[NICKLEN * 3 + 3] = { '\0' }; char *p = modebuf; int len = 0; const struct Membership *ms = ptr->data; if (has_member_flags(ms, CHFL_CHANOP)) { *p++ = 'o'; len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); } if (has_member_flags(ms, CHFL_HALFOP)) { *p++ = 'h'; len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); } if (has_member_flags(ms, CHFL_VOICE)) { *p++ = 'v'; len += snprintf(nickbuf + len, sizeof(nickbuf) - len, len ? " %s" : "%s", target_p->name); } *p = '\0'; sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s!%s@%s JOIN :%s", target_p->name, target_p->username, target_p->host, ms->chptr->chname); if (nickbuf[0]) sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s MODE %s +%s %s", target_p->servptr->name, ms->chptr->chname, modebuf, nickbuf); } if (target_p->away[0]) sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY, ":%s!%s@%s AWAY :%s", target_p->name, target_p->username, target_p->host, target_p->away); } /* user_welcome() * * inputs - client pointer to client to welcome * output - NONE * side effects - */ static void user_welcome(struct Client *source_p) { #if defined(__TIME__) && defined(__DATE__) static const char built_date[] = __DATE__ " at " __TIME__; #else static const char built_date[] = "unknown"; #endif #ifdef HAVE_LIBCRYPTO if (HasFlag(source_p, FLAGS_SSL)) { AddUMode(source_p, UMODE_SSL); sendto_one(source_p, ":%s NOTICE %s :*** Connected securely via %s", me.name, source_p->name, ssl_get_cipher(source_p->localClient->fd.ssl)); } #endif sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name, ServerInfo.network_name, source_p->name); sendto_one(source_p, form_str(RPL_YOURHOST), me.name, source_p->name, get_listener_name(source_p->localClient->listener), ircd_version); sendto_one(source_p, form_str(RPL_CREATED), me.name, source_p->name, built_date); sendto_one(source_p, form_str(RPL_MYINFO), me.name, source_p->name, me.name, ircd_version, umode_buffer); show_isupport(source_p); if (source_p->id[0] != '\0') sendto_one(source_p, form_str(RPL_YOURID), me.name, source_p->name, source_p->id); show_lusers(source_p); motd_signon(source_p); } /* check_xline() * * inputs - pointer to client to test * outupt - 1 if exiting 0 if ok * side effects - */ static int check_xline(struct Client *source_p) { struct MaskItem *conf = NULL; const char *reason = NULL; if ((conf = find_matching_name_conf(CONF_XLINE, source_p->info, NULL, NULL, 0))) { ++conf->count; if (conf->reason != NULL) reason = conf->reason; else reason = "No Reason"; sendto_realops_flags(UMODE_REJ, L_ALL, SEND_NOTICE, "X-line Rejecting [%s] [%s], user %s [%s]", source_p->info, reason, get_client_name(source_p, HIDE_IP), source_p->sockhost); ++ServerStats.is_ref; exit_client(source_p, &me, "Bad user info"); return 1; } return 0; } /* oper_up() * * inputs - pointer to given client to oper * output - NONE * side effects - Blindly opers up given source_p, using conf info * all checks on passwords have already been done. * This could also be used by rsa oper routines. */ void oper_up(struct Client *source_p) { const unsigned int old = source_p->umodes; const struct MaskItem *conf = source_p->localClient->confs.head->data; assert(source_p->localClient->confs.head); ++Count.oper; SetOper(source_p); if (conf->modes) AddUMode(source_p, conf->modes); else if (ConfigFileEntry.oper_umodes) AddUMode(source_p, ConfigFileEntry.oper_umodes); if (!(old & UMODE_INVISIBLE) && HasUMode(source_p, UMODE_INVISIBLE)) ++Count.invisi; if ((old & UMODE_INVISIBLE) && !HasUMode(source_p, UMODE_INVISIBLE)) --Count.invisi; assert(dlinkFind(&oper_list, source_p) == NULL); dlinkAdd(source_p, make_dlink_node(), &oper_list); AddOFlag(source_p, conf->port); if (HasOFlag(source_p, OPER_FLAG_ADMIN)) AddUMode(source_p, UMODE_ADMIN); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s is now an operator", get_oper_name(source_p)); send_umode_out(source_p, source_p, old); sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); } static char new_uid[TOTALSIDUID + 1]; /* allow for \0 */ int valid_sid(const char *sid) { if (strlen(sid) == IRC_MAXSID) if (IsDigit(*sid)) if (IsAlNum(*(sid + 1)) && IsAlNum(*(sid + 2))) return 1; return 0; } /* * init_uid() * * inputs - NONE * output - NONE * side effects - new_uid is filled in with server id portion (sid) * (first 3 bytes) or defaulted to 'A'. * Rest is filled in with 'A' */ void init_uid(void) { unsigned int i; memset(new_uid, 0, sizeof(new_uid)); if (!EmptyString(ServerInfo.sid)) strlcpy(new_uid, ServerInfo.sid, sizeof(new_uid)); for (i = 0; i < IRC_MAXSID; ++i) if (new_uid[i] == '\0') new_uid[i] = 'A'; /* NOTE: if IRC_MAXUID != 6, this will have to be rewritten */ memcpy(new_uid + IRC_MAXSID, "AAAAA@", IRC_MAXUID); } /* * add_one_to_uid * * inputs - index number into new_uid * output - NONE * side effects - new_uid is incremented by one * note this is a recursive function */ static void add_one_to_uid(int i) { if (i != IRC_MAXSID) /* Not reached server SID portion yet? */ { if (new_uid[i] == 'Z') new_uid[i] = '0'; else if (new_uid[i] == '9') { new_uid[i] = 'A'; add_one_to_uid(i-1); } else ++new_uid[i]; } else { /* NOTE: if IRC_MAXUID != 6, this will have to be rewritten */ if (new_uid[i] == 'Z') memcpy(new_uid + IRC_MAXSID, "AAAAAA", IRC_MAXUID); else ++new_uid[i]; } } /* * uid_get * * inputs - struct Client * * output - new UID is returned to caller * side effects - new_uid is incremented by one. */ static const char * uid_get(void) { add_one_to_uid(TOTALSIDUID - 1); /* index from 0 */ return new_uid; } /* * init_isupport() * * input - NONE * output - NONE * side effects - Must be called before isupport is enabled */ void init_isupport(void) { add_isupport("CALLERID", NULL, -1); add_isupport("CASEMAPPING", CASEMAP, -1); add_isupport("DEAF", "D", -1); add_isupport("KICKLEN", NULL, KICKLEN); add_isupport("MODES", NULL, MAXMODEPARAMS); #ifdef HALFOPS add_isupport("PREFIX", "(ohv)@%+", -1); add_isupport("STATUSMSG", "@%+", -1); #else add_isupport("PREFIX", "(ov)@+", -1); add_isupport("STATUSMSG", "@+", -1); #endif add_isupport("EXCEPTS", "e", -1); add_isupport("INVEX", "I", -1); } /* * add_isupport() * * input - name of supported function * - options if any * - number if any * output - NONE * side effects - Each supported item must call this when activated */ void add_isupport(const char *name, const char *options, int n) { dlink_node *ptr; struct Isupport *support; DLINK_FOREACH(ptr, support_list.head) { support = ptr->data; if (irccmp(support->name, name) == 0) { MyFree(support->name); MyFree(support->options); break; } } if (ptr == NULL) { support = MyMalloc(sizeof(*support)); dlinkAddTail(support, &support->node, &support_list); } support->name = xstrdup(name); if (options != NULL) support->options = xstrdup(options); support->number = n; rebuild_isupport_message_line(); } /* * delete_isupport() * * input - name of supported function * output - NONE * side effects - Each supported item must call this when deactivated */ void delete_isupport(const char *name) { dlink_node *ptr; struct Isupport *support; DLINK_FOREACH(ptr, support_list.head) { support = ptr->data; if (irccmp(support->name, name) == 0) { dlinkDelete(ptr, &support_list); MyFree(support->name); MyFree(support->options); MyFree(support); break; } } rebuild_isupport_message_line(); } /* * rebuild_isupport_message_line * * input - NONE * output - NONE * side effects - Destroy the isupport MessageFile lines, and rebuild. */ void rebuild_isupport_message_line(void) { char isupportbuffer[IRCD_BUFSIZE]; char *p = isupportbuffer; dlink_node *ptr = NULL, *ptr_next = NULL; int n = 0; int tokens = 0; size_t len = 0; size_t reserve = strlen(me.name) + HOSTLEN + strlen(form_str(RPL_ISUPPORT)); DLINK_FOREACH_SAFE(ptr, ptr_next, support_list_lines.head) { dlinkDelete(ptr, &support_list_lines); MyFree(ptr->data); free_dlink_node(ptr); } DLINK_FOREACH(ptr, support_list.head) { struct Isupport *support = ptr->data; p += (n = sprintf(p, "%s", support->name)); len += n; if (support->options != NULL) { p += (n = sprintf(p, "=%s", support->options)); len += n; } if (support->number > 0) { p += (n = sprintf(p, "=%d", support->number)); len += n; } *p++ = ' '; len++; *p = '\0'; if (++tokens == (MAXPARA-2) || len >= (sizeof(isupportbuffer)-reserve)) { /* arbritrary for now */ if (*--p == ' ') *p = '\0'; dlinkAddTail(xstrdup(isupportbuffer), make_dlink_node(), &support_list_lines); p = isupportbuffer; len = 0; n = tokens = 0; } } if (len != 0) { if (*--p == ' ') *p = '\0'; dlinkAddTail(xstrdup(isupportbuffer), make_dlink_node(), &support_list_lines); } } ircd-hybrid-8.1.13.dfsg.1/src/conf_parser.y0000644000175000017500000022327212263053413016476 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * conf_parser.y: Parses the ircd configuration file. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: conf_parser.y 2398 2013-07-16 14:13:31Z michael $ */ %{ #define YY_NO_UNPUT #include #include #include "config.h" #include "stdinc.h" #include "ircd.h" #include "list.h" #include "conf.h" #include "conf_class.h" #include "event.h" #include "log.h" #include "client.h" /* for UMODE_ALL only */ #include "irc_string.h" #include "memory.h" #include "modules.h" #include "s_serv.h" #include "hostmask.h" #include "send.h" #include "listener.h" #include "resv.h" #include "numeric.h" #include "s_user.h" #include "motd.h" #ifdef HAVE_LIBCRYPTO #include #include #include #include #endif #include "rsa.h" int yylex(void); static struct { struct { dlink_list list; } mask, leaf, hub; struct { char buf[IRCD_BUFSIZE]; } name, user, host, addr, bind, file, ciph, cert, rpass, spass, class; struct { unsigned int value; } flags, modes, size, type, port, aftype, ping_freq, max_perip, con_freq, min_idle, max_idle, max_total, max_global, max_local, max_ident, max_sendq, max_recvq, cidr_bitlen_ipv4, cidr_bitlen_ipv6, number_per_cidr; } block_state; static void reset_block_state(void) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.mask.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.mask.list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.leaf.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.leaf.list); free_dlink_node(ptr); } DLINK_FOREACH_SAFE(ptr, ptr_next, block_state.hub.list.head) { MyFree(ptr->data); dlinkDelete(ptr, &block_state.hub.list); free_dlink_node(ptr); } memset(&block_state, 0, sizeof(block_state)); } %} %union { int number; char *string; } %token ACCEPT_PASSWORD %token ADMIN %token AFTYPE %token ANTI_NICK_FLOOD %token ANTI_SPAM_EXIT_MESSAGE_TIME %token AUTOCONN %token BYTES KBYTES MBYTES %token CALLER_ID_WAIT %token CAN_FLOOD %token CHANNEL %token CIDR_BITLEN_IPV4 %token CIDR_BITLEN_IPV6 %token CLASS %token CONNECT %token CONNECTFREQ %token CYCLE_ON_HOST_CHANGE %token DEFAULT_FLOODCOUNT %token DEFAULT_SPLIT_SERVER_COUNT %token DEFAULT_SPLIT_USER_COUNT %token DENY %token DESCRIPTION %token DIE %token DISABLE_AUTH %token DISABLE_FAKE_CHANNELS %token DISABLE_REMOTE_COMMANDS %token DOTS_IN_IDENT %token EGDPOOL_PATH %token EMAIL %token ENCRYPTED %token EXCEED_LIMIT %token EXEMPT %token FAILED_OPER_NOTICE %token FLATTEN_LINKS %token GECOS %token GENERAL %token GLINE %token GLINE_DURATION %token GLINE_ENABLE %token GLINE_EXEMPT %token GLINE_MIN_CIDR %token GLINE_MIN_CIDR6 %token GLINE_REQUEST_DURATION %token GLOBAL_KILL %token HAVENT_READ_CONF %token HIDDEN %token HIDDEN_NAME %token HIDE_IDLE_FROM_OPERS %token HIDE_SERVER_IPS %token HIDE_SERVERS %token HIDE_SERVICES %token HIDE_SPOOF_IPS %token HOST %token HUB %token HUB_MASK %token IGNORE_BOGUS_TS %token INVISIBLE_ON_CONNECT %token IP %token IRCD_AUTH %token IRCD_FLAGS %token IRCD_SID %token JOIN_FLOOD_COUNT %token JOIN_FLOOD_TIME %token KILL %token KILL_CHASE_TIME_LIMIT %token KLINE %token KLINE_EXEMPT %token KNOCK_DELAY %token KNOCK_DELAY_CHANNEL %token LEAF_MASK %token LINKS_DELAY %token LISTEN %token MASK %token MAX_ACCEPT %token MAX_BANS %token MAX_CHANS_PER_OPER %token MAX_CHANS_PER_USER %token MAX_GLOBAL %token MAX_IDENT %token MAX_IDLE %token MAX_LOCAL %token MAX_NICK_CHANGES %token MAX_NICK_LENGTH %token MAX_NICK_TIME %token MAX_NUMBER %token MAX_TARGETS %token MAX_TOPIC_LENGTH %token MAX_WATCH %token MIN_IDLE %token MIN_NONWILDCARD %token MIN_NONWILDCARD_SIMPLE %token MODULE %token MODULES %token MOTD %token NAME %token NEED_IDENT %token NEED_PASSWORD %token NETWORK_DESC %token NETWORK_NAME %token NICK %token NO_CREATE_ON_SPLIT %token NO_JOIN_ON_SPLIT %token NO_OPER_FLOOD %token NO_TILDE %token NUMBER %token NUMBER_PER_CIDR %token NUMBER_PER_IP %token OPER_ONLY_UMODES %token OPER_PASS_RESV %token OPER_UMODES %token OPERATOR %token OPERS_BYPASS_CALLERID %token PACE_WAIT %token PACE_WAIT_SIMPLE %token PASSWORD %token PATH %token PING_COOKIE %token PING_TIME %token PORT %token QSTRING %token RANDOM_IDLE %token REASON %token REDIRPORT %token REDIRSERV %token REHASH %token REMOTE %token REMOTEBAN %token RESV %token RESV_EXEMPT %token RSA_PRIVATE_KEY_FILE %token RSA_PUBLIC_KEY_FILE %token SECONDS MINUTES HOURS DAYS WEEKS MONTHS YEARS %token SEND_PASSWORD %token SENDQ %token SERVERHIDE %token SERVERINFO %token SHORT_MOTD %token SPOOF %token SPOOF_NOTICE %token SQUIT %token SSL_CERTIFICATE_FILE %token SSL_CERTIFICATE_FINGERPRINT %token SSL_CONNECTION_REQUIRED %token SSL_DH_PARAM_FILE %token STATS_E_DISABLED %token STATS_I_OPER_ONLY %token STATS_K_OPER_ONLY %token STATS_O_OPER_ONLY %token STATS_P_OPER_ONLY %token STATS_U_OPER_ONLY %token T_ALL %token T_BOTS %token T_CALLERID %token T_CCONN %token T_CLUSTER %token T_DEAF %token T_DEBUG %token T_DLINE %token T_EXTERNAL %token T_FARCONNECT %token T_FILE %token T_FULL %token T_GLOBOPS %token T_INVISIBLE %token T_IPV4 %token T_IPV6 %token T_LOCOPS %token T_LOG %token T_MAX_CLIENTS %token T_NCHANGE %token T_NONONREG %token T_OPERWALL %token T_RECVQ %token T_REJ %token T_RESTART %token T_SERVER %token T_SERVICE %token T_SERVICES_NAME %token T_SERVNOTICE %token T_SET %token T_SHARED %token T_SIZE %token T_SKILL %token T_SOFTCALLERID %token T_SPY %token T_SSL %token T_SSL_CIPHER_LIST %token T_SSL_CLIENT_METHOD %token T_SSL_SERVER_METHOD %token T_SSLV3 %token T_TLSV1 %token T_UMODES %token T_UNAUTH %token T_UNDLINE %token T_UNLIMITED %token T_UNRESV %token T_UNXLINE %token T_WALLOP %token T_WALLOPS %token T_WEBIRC %token TBOOL %token THROTTLE_TIME %token TKLINE_EXPIRE_NOTICES %token TMASKED %token TRUE_NO_OPER_FLOOD %token TS_MAX_DELTA %token TS_WARN_DELTA %token TWODOTS %token TYPE %token UNKLINE %token USE_EGD %token USE_LOGGING %token USER %token VHOST %token VHOST6 %token WARN_NO_NLINE %token XLINE %type QSTRING %type NUMBER %type timespec %type timespec_ %type sizespec %type sizespec_ %% conf: | conf conf_item ; conf_item: admin_entry | logging_entry | oper_entry | channel_entry | class_entry | listen_entry | auth_entry | serverinfo_entry | serverhide_entry | resv_entry | service_entry | shared_entry | cluster_entry | connect_entry | kill_entry | deny_entry | exempt_entry | general_entry | gecos_entry | modules_entry | motd_entry | error ';' | error '}' ; timespec_: { $$ = 0; } | timespec; timespec: NUMBER timespec_ { $$ = $1 + $2; } | NUMBER SECONDS timespec_ { $$ = $1 + $3; } | NUMBER MINUTES timespec_ { $$ = $1 * 60 + $3; } | NUMBER HOURS timespec_ { $$ = $1 * 60 * 60 + $3; } | NUMBER DAYS timespec_ { $$ = $1 * 60 * 60 * 24 + $3; } | NUMBER WEEKS timespec_ { $$ = $1 * 60 * 60 * 24 * 7 + $3; } | NUMBER MONTHS timespec_ { $$ = $1 * 60 * 60 * 24 * 7 * 4 + $3; } | NUMBER YEARS timespec_ { $$ = $1 * 60 * 60 * 24 * 365 + $3; } ; sizespec_: { $$ = 0; } | sizespec; sizespec: NUMBER sizespec_ { $$ = $1 + $2; } | NUMBER BYTES sizespec_ { $$ = $1 + $3; } | NUMBER KBYTES sizespec_ { $$ = $1 * 1024 + $3; } | NUMBER MBYTES sizespec_ { $$ = $1 * 1024 * 1024 + $3; } ; /*************************************************************************** * section modules ***************************************************************************/ modules_entry: MODULES '{' modules_items '}' ';'; modules_items: modules_items modules_item | modules_item; modules_item: modules_module | modules_path | error ';' ; modules_module: MODULE '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) add_conf_module(libio_basename(yylval.string)); }; modules_path: PATH '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) mod_add_path(yylval.string); }; serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';'; serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ; serverinfo_item: serverinfo_name | serverinfo_vhost | serverinfo_hub | serverinfo_description | serverinfo_network_name | serverinfo_network_desc | serverinfo_max_clients | serverinfo_max_nick_length | serverinfo_max_topic_length | serverinfo_ssl_dh_param_file | serverinfo_rsa_private_key_file | serverinfo_vhost6 | serverinfo_sid | serverinfo_ssl_certificate_file | serverinfo_ssl_client_method | serverinfo_ssl_server_method | serverinfo_ssl_cipher_list | error ';' ; serverinfo_ssl_client_method: T_SSL_CLIENT_METHOD '=' client_method_types ';' ; serverinfo_ssl_server_method: T_SSL_SERVER_METHOD '=' server_method_types ';' ; client_method_types: client_method_types ',' client_method_type_item | client_method_type_item; client_method_type_item: T_SSLV3 { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv3); #endif } | T_TLSV1 { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.client_ctx) SSL_CTX_clear_options(ServerInfo.client_ctx, SSL_OP_NO_TLSv1); #endif }; server_method_types: server_method_types ',' server_method_type_item | server_method_type_item; server_method_type_item: T_SSLV3 { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv3); #endif } | T_TLSV1 { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_clear_options(ServerInfo.server_ctx, SSL_OP_NO_TLSv1); #endif }; serverinfo_ssl_certificate_file: SSL_CERTIFICATE_FILE '=' QSTRING ';' { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) { if (!ServerInfo.rsa_private_key_file) { conf_error_report("No rsa_private_key_file specified, SSL disabled"); break; } if (SSL_CTX_use_certificate_file(ServerInfo.server_ctx, yylval.string, SSL_FILETYPE_PEM) <= 0 || SSL_CTX_use_certificate_file(ServerInfo.client_ctx, yylval.string, SSL_FILETYPE_PEM) <= 0) { report_crypto_errors(); conf_error_report("Could not open/read certificate file"); break; } if (SSL_CTX_use_PrivateKey_file(ServerInfo.server_ctx, ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0 || SSL_CTX_use_PrivateKey_file(ServerInfo.client_ctx, ServerInfo.rsa_private_key_file, SSL_FILETYPE_PEM) <= 0) { report_crypto_errors(); conf_error_report("Could not read RSA private key"); break; } if (!SSL_CTX_check_private_key(ServerInfo.server_ctx) || !SSL_CTX_check_private_key(ServerInfo.client_ctx)) { report_crypto_errors(); conf_error_report("Could not read RSA private key"); break; } } #endif }; serverinfo_rsa_private_key_file: RSA_PRIVATE_KEY_FILE '=' QSTRING ';' { #ifdef HAVE_LIBCRYPTO BIO *file = NULL; if (conf_parser_ctx.pass != 1) break; if (ServerInfo.rsa_private_key) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; } if (ServerInfo.rsa_private_key_file) { MyFree(ServerInfo.rsa_private_key_file); ServerInfo.rsa_private_key_file = NULL; } ServerInfo.rsa_private_key_file = xstrdup(yylval.string); if ((file = BIO_new_file(yylval.string, "r")) == NULL) { conf_error_report("File open failed, ignoring"); break; } ServerInfo.rsa_private_key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); BIO_set_close(file, BIO_CLOSE); BIO_free(file); if (ServerInfo.rsa_private_key == NULL) { conf_error_report("Couldn't extract key, ignoring"); break; } if (!RSA_check_key(ServerInfo.rsa_private_key)) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; conf_error_report("Invalid key, ignoring"); break; } /* require 2048 bit (256 byte) key */ if (RSA_size(ServerInfo.rsa_private_key) != 256) { RSA_free(ServerInfo.rsa_private_key); ServerInfo.rsa_private_key = NULL; conf_error_report("Not a 2048 bit key, ignoring"); } #endif }; serverinfo_ssl_dh_param_file: SSL_DH_PARAM_FILE '=' QSTRING ';' { /* TBD - XXX: error reporting */ #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) { BIO *file = BIO_new_file(yylval.string, "r"); if (file) { DH *dh = PEM_read_bio_DHparams(file, NULL, NULL, NULL); BIO_free(file); if (dh) { if (DH_size(dh) < 128) conf_error_report("Ignoring serverinfo::ssl_dh_param_file -- need at least a 1024 bit DH prime size"); else SSL_CTX_set_tmp_dh(ServerInfo.server_ctx, dh); DH_free(dh); } } } #endif }; serverinfo_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2 && ServerInfo.server_ctx) SSL_CTX_set_cipher_list(ServerInfo.server_ctx, yylval.string); #endif }; serverinfo_name: NAME '=' QSTRING ';' { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.name) { if (valid_servname(yylval.string)) ServerInfo.name = xstrdup(yylval.string); else { conf_error_report("Ignoring serverinfo::name -- invalid name. Aborting."); exit(0); } } }; serverinfo_sid: IRCD_SID '=' QSTRING ';' { /* this isn't rehashable */ if (conf_parser_ctx.pass == 2 && !ServerInfo.sid) { if (valid_sid(yylval.string)) ServerInfo.sid = xstrdup(yylval.string); else { conf_error_report("Ignoring serverinfo::sid -- invalid SID. Aborting."); exit(0); } } }; serverinfo_description: DESCRIPTION '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { MyFree(ServerInfo.description); ServerInfo.description = xstrdup(yylval.string); } }; serverinfo_network_name: NETWORK_NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { char *p; if ((p = strchr(yylval.string, ' ')) != NULL) p = '\0'; MyFree(ServerInfo.network_name); ServerInfo.network_name = xstrdup(yylval.string); } }; serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; MyFree(ServerInfo.network_desc); ServerInfo.network_desc = xstrdup(yylval.string); }; serverinfo_vhost: VHOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2 && *yylval.string != '*') { struct addrinfo hints, *res; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(yylval.string, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", yylval.string); else { assert(res != NULL); memcpy(&ServerInfo.ip, res->ai_addr, res->ai_addrlen); ServerInfo.ip.ss.ss_family = res->ai_family; ServerInfo.ip.ss_len = res->ai_addrlen; freeaddrinfo(res); ServerInfo.specific_ipv4_vhost = 1; } } }; serverinfo_vhost6: VHOST6 '=' QSTRING ';' { #ifdef IPV6 if (conf_parser_ctx.pass == 2 && *yylval.string != '*') { struct addrinfo hints, *res; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(yylval.string, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost6(%s)", yylval.string); else { assert(res != NULL); memcpy(&ServerInfo.ip6, res->ai_addr, res->ai_addrlen); ServerInfo.ip6.ss.ss_family = res->ai_family; ServerInfo.ip6.ss_len = res->ai_addrlen; freeaddrinfo(res); ServerInfo.specific_ipv6_vhost = 1; } } #endif }; serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';' { if (conf_parser_ctx.pass != 2) break; if ($3 < MAXCLIENTS_MIN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN); conf_error_report(buf); ServerInfo.max_clients = MAXCLIENTS_MIN; } else if ($3 > MAXCLIENTS_MAX) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX); conf_error_report(buf); ServerInfo.max_clients = MAXCLIENTS_MAX; } else ServerInfo.max_clients = $3; }; serverinfo_max_nick_length: MAX_NICK_LENGTH '=' NUMBER ';' { if (conf_parser_ctx.pass != 2) break; if ($3 < 9) { conf_error_report("max_nick_length too low, setting to 9"); ServerInfo.max_nick_length = 9; } else if ($3 > NICKLEN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLEN); conf_error_report(buf); ServerInfo.max_nick_length = NICKLEN; } else ServerInfo.max_nick_length = $3; }; serverinfo_max_topic_length: MAX_TOPIC_LENGTH '=' NUMBER ';' { if (conf_parser_ctx.pass != 2) break; if ($3 < 80) { conf_error_report("max_topic_length too low, setting to 80"); ServerInfo.max_topic_length = 80; } else if ($3 > TOPICLEN) { char buf[IRCD_BUFSIZE]; snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPICLEN); conf_error_report(buf); ServerInfo.max_topic_length = TOPICLEN; } else ServerInfo.max_topic_length = $3; }; serverinfo_hub: HUB '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ServerInfo.hub = yylval.number; }; /*************************************************************************** * admin section ***************************************************************************/ admin_entry: ADMIN '{' admin_items '}' ';' ; admin_items: admin_items admin_item | admin_item; admin_item: admin_name | admin_description | admin_email | error ';' ; admin_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.name); AdminInfo.name = xstrdup(yylval.string); }; admin_email: EMAIL '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.email); AdminInfo.email = xstrdup(yylval.string); }; admin_description: DESCRIPTION '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; MyFree(AdminInfo.description); AdminInfo.description = xstrdup(yylval.string); }; /*************************************************************************** * motd section ***************************************************************************/ motd_entry: MOTD { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' motd_items '}' ';' { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.file.buf[0]) break; DLINK_FOREACH(ptr, block_state.mask.list.head) motd_add(ptr->data, block_state.file.buf); }; motd_items: motd_items motd_item | motd_item; motd_item: motd_mask | motd_file | error ';' ; motd_mask: MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); }; motd_file: T_FILE '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); }; /*************************************************************************** * section logging ***************************************************************************/ logging_entry: T_LOG '{' logging_items '}' ';' ; logging_items: logging_items logging_item | logging_item ; logging_item: logging_use_logging | logging_file_entry | error ';' ; logging_use_logging: USE_LOGGING '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigLoggingEntry.use_logging = yylval.number; }; logging_file_entry: { if (conf_parser_ctx.pass == 2) reset_block_state(); } T_FILE '{' logging_file_items '}' ';' { if (conf_parser_ctx.pass != 2) break; if (block_state.type.value && block_state.file.buf[0]) log_set_file(block_state.type.value, block_state.size.value, block_state.file.buf); }; logging_file_items: logging_file_items logging_file_item | logging_file_item ; logging_file_item: logging_file_name | logging_file_type | logging_file_size | error ';' ; logging_file_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); } logging_file_size: T_SIZE '=' sizespec ';' { block_state.size.value = $3; } | T_SIZE '=' T_UNLIMITED ';' { block_state.size.value = 0; }; logging_file_type: TYPE { if (conf_parser_ctx.pass == 2) block_state.type.value = 0; } '=' logging_file_type_items ';' ; logging_file_type_items: logging_file_type_items ',' logging_file_type_item | logging_file_type_item; logging_file_type_item: USER { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_USER; } | OPERATOR { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_OPER; } | GLINE { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_GLINE; } | XLINE { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_XLINE; } | RESV { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_RESV; } | T_DLINE { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_DLINE; } | KLINE { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_KLINE; } | KILL { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_KILL; } | T_DEBUG { if (conf_parser_ctx.pass == 2) block_state.type.value = LOG_TYPE_DEBUG; }; /*************************************************************************** * section oper ***************************************************************************/ oper_entry: OPERATOR { if (conf_parser_ctx.pass != 2) break; reset_block_state(); block_state.flags.value |= CONF_FLAGS_ENCRYPTED; } '{' oper_items '}' ';' { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0]) break; #ifdef HAVE_LIBCRYPTO if (!block_state.file.buf[0] && !block_state.rpass.buf[0]) break; #else if (!block_state.rpass.buf[0]) break; #endif DLINK_FOREACH(ptr, block_state.mask.list.head) { struct MaskItem *conf = NULL; struct split_nuh_item nuh; nuh.nuhmask = ptr->data; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); conf = conf_make(CONF_OPER); conf->name = xstrdup(block_state.name.buf); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.cert.buf[0]) conf->certfp = xstrdup(block_state.cert.buf); if (block_state.rpass.buf[0]) conf->passwd = xstrdup(block_state.rpass.buf); conf->flags = block_state.flags.value; conf->modes = block_state.modes.value; conf->port = block_state.port.value; conf->htype = parse_netmask(conf->host, &conf->addr, &conf->bits); conf_add_class_to_conf(conf, block_state.class.buf); #ifdef HAVE_LIBCRYPTO if (block_state.file.buf[0]) { BIO *file = NULL; RSA *pkey = NULL; if ((file = BIO_new_file(block_state.file.buf, "r")) == NULL) { conf_error_report("Ignoring rsa_public_key_file -- file doesn't exist"); break; } if ((pkey = PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL)) == NULL) conf_error_report("Ignoring rsa_public_key_file -- Key invalid; check key syntax."); conf->rsa_public_key = pkey; BIO_set_close(file, BIO_CLOSE); BIO_free(file); } #endif /* HAVE_LIBCRYPTO */ } }; oper_items: oper_items oper_item | oper_item; oper_item: oper_name | oper_user | oper_password | oper_umodes | oper_class | oper_encrypted | oper_rsa_public_key_file | oper_ssl_certificate_fingerprint | oper_ssl_connection_required | oper_flags | error ';' ; oper_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; oper_user: USER '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); }; oper_password: PASSWORD '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; oper_encrypted: ENCRYPTED '=' TBOOL ';' { if (conf_parser_ctx.pass != 2) break; if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; }; oper_rsa_public_key_file: RSA_PUBLIC_KEY_FILE '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.file.buf, yylval.string, sizeof(block_state.file.buf)); }; oper_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); }; oper_ssl_connection_required: SSL_CONNECTION_REQUIRED '=' TBOOL ';' { if (conf_parser_ctx.pass != 2) break; if (yylval.number) block_state.flags.value |= CONF_FLAGS_SSL; else block_state.flags.value &= ~CONF_FLAGS_SSL; }; oper_class: CLASS '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); }; oper_umodes: T_UMODES { if (conf_parser_ctx.pass == 2) block_state.modes.value = 0; } '=' oper_umodes_items ';' ; oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item; oper_umodes_item: T_BOTS { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_BOTS; } | T_CCONN { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_CCONN; } | T_DEAF { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_DEAF; } | T_DEBUG { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_DEBUG; } | T_FULL { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_FULL; } | HIDDEN { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_HIDDEN; } | T_SKILL { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SKILL; } | T_NCHANGE { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_NCHANGE; } | T_REJ { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_REJ; } | T_UNAUTH { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_UNAUTH; } | T_SPY { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SPY; } | T_EXTERNAL { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_EXTERNAL; } | T_OPERWALL { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_OPERWALL; } | T_SERVNOTICE { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SERVNOTICE; } | T_INVISIBLE { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_INVISIBLE; } | T_WALLOP { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_WALLOP; } | T_SOFTCALLERID { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_SOFTCALLERID; } | T_CALLERID { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_CALLERID; } | T_LOCOPS { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_LOCOPS; } | T_NONONREG { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_REGONLY; } | T_FARCONNECT { if (conf_parser_ctx.pass == 2) block_state.modes.value |= UMODE_FARCONNECT; }; oper_flags: IRCD_FLAGS { if (conf_parser_ctx.pass == 2) block_state.port.value = 0; } '=' oper_flags_items ';'; oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item; oper_flags_item: KILL ':' REMOTE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_KILL_REMOTE; } | KILL { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_KILL; } | CONNECT ':' REMOTE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_CONNECT_REMOTE; } | CONNECT { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_CONNECT; } | SQUIT ':' REMOTE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SQUIT_REMOTE; } | SQUIT { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SQUIT; } | KLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_K; } | UNKLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_UNKLINE; } | T_DLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_DLINE; } | T_UNDLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_UNDLINE; } | XLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_X; } | GLINE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_GLINE; } | DIE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_DIE; } | T_RESTART { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_RESTART; } | REHASH { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_REHASH; } | ADMIN { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_ADMIN; } | T_OPERWALL { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_OPERWALL; } | T_GLOBOPS { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_GLOBOPS; } | T_WALLOPS { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_WALLOPS; } | T_LOCOPS { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_LOCOPS; } | REMOTEBAN { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_REMOTEBAN; } | T_SET { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_SET; } | MODULE { if (conf_parser_ctx.pass == 2) block_state.port.value |= OPER_FLAG_MODULE; }; /*************************************************************************** * section class ***************************************************************************/ class_entry: CLASS { if (conf_parser_ctx.pass != 1) break; reset_block_state(); block_state.ping_freq.value = DEFAULT_PINGFREQUENCY; block_state.con_freq.value = DEFAULT_CONNECTFREQUENCY; block_state.max_total.value = MAXIMUM_LINKS_DEFAULT; block_state.max_sendq.value = DEFAULT_SENDQ; block_state.max_recvq.value = DEFAULT_RECVQ; } '{' class_items '}' ';' { struct ClassItem *class = NULL; if (conf_parser_ctx.pass != 1) break; if (!block_state.class.buf[0]) break; if (!(class = class_find(block_state.class.buf, 0))) class = class_make(); class->active = 1; MyFree(class->name); class->name = xstrdup(block_state.class.buf); class->ping_freq = block_state.ping_freq.value; class->max_perip = block_state.max_perip.value; class->con_freq = block_state.con_freq.value; class->max_total = block_state.max_total.value; class->max_global = block_state.max_global.value; class->max_local = block_state.max_local.value; class->max_ident = block_state.max_ident.value; class->max_sendq = block_state.max_sendq.value; class->max_recvq = block_state.max_recvq.value; if (block_state.min_idle.value > block_state.max_idle.value) { block_state.min_idle.value = 0; block_state.max_idle.value = 0; block_state.flags.value &= ~CLASS_FLAGS_FAKE_IDLE; } class->flags = block_state.flags.value; class->min_idle = block_state.min_idle.value; class->max_idle = block_state.max_idle.value; if (class->number_per_cidr && block_state.number_per_cidr.value) if ((class->cidr_bitlen_ipv4 && block_state.cidr_bitlen_ipv4.value) || (class->cidr_bitlen_ipv6 && block_state.cidr_bitlen_ipv6.value)) if ((class->cidr_bitlen_ipv4 != block_state.cidr_bitlen_ipv4.value) || (class->cidr_bitlen_ipv6 != block_state.cidr_bitlen_ipv6.value)) rebuild_cidr_list(class); class->cidr_bitlen_ipv4 = block_state.cidr_bitlen_ipv4.value; class->cidr_bitlen_ipv6 = block_state.cidr_bitlen_ipv6.value; class->number_per_cidr = block_state.number_per_cidr.value; }; class_items: class_items class_item | class_item; class_item: class_name | class_cidr_bitlen_ipv4 | class_cidr_bitlen_ipv6 | class_ping_time | class_number_per_cidr | class_number_per_ip | class_connectfreq | class_max_number | class_max_global | class_max_local | class_max_ident | class_sendq | class_recvq | class_min_idle | class_max_idle | class_flags | error ';' ; class_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 1) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); }; class_ping_time: PING_TIME '=' timespec ';' { if (conf_parser_ctx.pass == 1) block_state.ping_freq.value = $3; }; class_number_per_ip: NUMBER_PER_IP '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.max_perip.value = $3; }; class_connectfreq: CONNECTFREQ '=' timespec ';' { if (conf_parser_ctx.pass == 1) block_state.con_freq.value = $3; }; class_max_number: MAX_NUMBER '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.max_total.value = $3; }; class_max_global: MAX_GLOBAL '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.max_global.value = $3; }; class_max_local: MAX_LOCAL '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.max_local.value = $3; }; class_max_ident: MAX_IDENT '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.max_ident.value = $3; }; class_sendq: SENDQ '=' sizespec ';' { if (conf_parser_ctx.pass == 1) block_state.max_sendq.value = $3; }; class_recvq: T_RECVQ '=' sizespec ';' { if (conf_parser_ctx.pass == 1) if ($3 >= CLIENT_FLOOD_MIN && $3 <= CLIENT_FLOOD_MAX) block_state.max_recvq.value = $3; }; class_cidr_bitlen_ipv4: CIDR_BITLEN_IPV4 '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.cidr_bitlen_ipv4.value = $3 > 32 ? 32 : $3; }; class_cidr_bitlen_ipv6: CIDR_BITLEN_IPV6 '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.cidr_bitlen_ipv6.value = $3 > 128 ? 128 : $3; }; class_number_per_cidr: NUMBER_PER_CIDR '=' NUMBER ';' { if (conf_parser_ctx.pass == 1) block_state.number_per_cidr.value = $3; }; class_min_idle: MIN_IDLE '=' timespec ';' { if (conf_parser_ctx.pass != 1) break; block_state.min_idle.value = $3; block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; }; class_max_idle: MAX_IDLE '=' timespec ';' { if (conf_parser_ctx.pass != 1) break; block_state.max_idle.value = $3; block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; }; class_flags: IRCD_FLAGS { if (conf_parser_ctx.pass == 1) block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE; } '=' class_flags_items ';'; class_flags_items: class_flags_items ',' class_flags_item | class_flags_item; class_flags_item: RANDOM_IDLE { if (conf_parser_ctx.pass == 1) block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE; } | HIDE_IDLE_FROM_OPERS { if (conf_parser_ctx.pass == 1) block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS; }; /*************************************************************************** * section listen ***************************************************************************/ listen_entry: LISTEN { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' listen_items '}' ';'; listen_flags: IRCD_FLAGS { block_state.flags.value = 0; } '=' listen_flags_items ';'; listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item; listen_flags_item: T_SSL { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_SSL; } | HIDDEN { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_HIDDEN; } | T_SERVER { if (conf_parser_ctx.pass == 2) block_state.flags.value |= LISTENER_SERVER; }; listen_items: listen_items listen_item | listen_item; listen_item: listen_port | listen_flags | listen_address | listen_host | error ';'; listen_port: PORT '=' port_items { block_state.flags.value = 0; } ';'; port_items: port_items ',' port_item | port_item; port_item: NUMBER { if (conf_parser_ctx.pass == 2) { if (block_state.flags.value & LISTENER_SSL) #ifdef HAVE_LIBCRYPTO if (!ServerInfo.server_ctx) #endif { conf_error_report("SSL not available - port closed"); break; } add_listener($1, block_state.addr.buf, block_state.flags.value); } } | NUMBER TWODOTS NUMBER { if (conf_parser_ctx.pass == 2) { int i; if (block_state.flags.value & LISTENER_SSL) #ifdef HAVE_LIBCRYPTO if (!ServerInfo.server_ctx) #endif { conf_error_report("SSL not available - port closed"); break; } for (i = $1; i <= $3; ++i) add_listener(i, block_state.addr.buf, block_state.flags.value); } }; listen_address: IP '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); }; listen_host: HOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); }; /*************************************************************************** * section auth ***************************************************************************/ auth_entry: IRCD_AUTH { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' auth_items '}' ';' { dlink_node *ptr = NULL; if (conf_parser_ctx.pass != 2) break; DLINK_FOREACH(ptr, block_state.mask.list.head) { struct MaskItem *conf = NULL; struct split_nuh_item nuh; nuh.nuhmask = ptr->data; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); conf = conf_make(CONF_CLIENT); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.rpass.buf[0]) conf->passwd = xstrdup(block_state.rpass.buf); if (block_state.name.buf[0]) conf->name = xstrdup(block_state.name.buf); conf->flags = block_state.flags.value; conf->port = block_state.port.value; conf_add_class_to_conf(conf, block_state.class.buf); add_conf_by_address(CONF_CLIENT, conf); } }; auth_items: auth_items auth_item | auth_item; auth_item: auth_user | auth_passwd | auth_class | auth_flags | auth_spoof | auth_redir_serv | auth_redir_port | auth_encrypted | error ';' ; auth_user: USER '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); }; auth_passwd: PASSWORD '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; auth_class: CLASS '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); }; auth_encrypted: ENCRYPTED '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) { if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; } }; auth_flags: IRCD_FLAGS { if (conf_parser_ctx.pass == 2) block_state.flags.value &= (CONF_FLAGS_ENCRYPTED | CONF_FLAGS_SPOOF_IP); } '=' auth_flags_items ';'; auth_flags_items: auth_flags_items ',' auth_flags_item | auth_flags_item; auth_flags_item: SPOOF_NOTICE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_SPOOF_NOTICE; } | EXCEED_LIMIT { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NOLIMIT; } | KLINE_EXEMPT { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTKLINE; } | NEED_IDENT { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NEED_IDENTD; } | CAN_FLOOD { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_CAN_FLOOD; } | NO_TILDE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NO_TILDE; } | GLINE_EXEMPT { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTGLINE; } | RESV_EXEMPT { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_EXEMPTRESV; } | T_WEBIRC { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_WEBIRC; } | NEED_PASSWORD { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_NEED_PASSWORD; }; auth_spoof: SPOOF '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; if (strlen(yylval.string) <= HOSTLEN && valid_hostname(yylval.string)) { strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); block_state.flags.value |= CONF_FLAGS_SPOOF_IP; } else ilog(LOG_TYPE_IRCD, "Spoof either is too long or contains invalid characters. Ignoring it."); }; auth_redir_serv: REDIRSERV '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); block_state.flags.value |= CONF_FLAGS_REDIR; }; auth_redir_port: REDIRPORT '=' NUMBER ';' { if (conf_parser_ctx.pass != 2) break; block_state.flags.value |= CONF_FLAGS_REDIR; block_state.port.value = $3; }; /*************************************************************************** * section resv ***************************************************************************/ resv_entry: RESV { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.rpass.buf, CONF_NOREASON, sizeof(block_state.rpass.buf)); } '{' resv_items '}' ';' { if (conf_parser_ctx.pass != 2) break; create_resv(block_state.name.buf, block_state.rpass.buf, &block_state.mask.list); }; resv_items: resv_items resv_item | resv_item; resv_item: resv_mask | resv_reason | resv_exempt | error ';' ; resv_mask: MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; resv_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; resv_exempt: EXEMPT '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.mask.list); }; /*************************************************************************** * section service ***************************************************************************/ service_entry: T_SERVICE '{' service_items '}' ';'; service_items: service_items service_item | service_item; service_item: service_name | error; service_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; if (valid_servname(yylval.string)) { struct MaskItem *conf = conf_make(CONF_SERVICE); conf->name = xstrdup(yylval.string); } }; /*************************************************************************** * section shared, for sharing remote klines etc. ***************************************************************************/ shared_entry: T_SHARED { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf)); strlcpy(block_state.user.buf, "*", sizeof(block_state.user.buf)); strlcpy(block_state.host.buf, "*", sizeof(block_state.host.buf)); block_state.flags.value = SHARED_ALL; } '{' shared_items '}' ';' { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; conf = conf_make(CONF_ULINE); conf->flags = block_state.flags.value; conf->name = xstrdup(block_state.name.buf); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); }; shared_items: shared_items shared_item | shared_item; shared_item: shared_name | shared_user | shared_type | error ';' ; shared_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; shared_user: USER '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { struct split_nuh_item nuh; nuh.nuhmask = yylval.string; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); } }; shared_type: TYPE { if (conf_parser_ctx.pass == 2) block_state.flags.value = 0; } '=' shared_types ';' ; shared_types: shared_types ',' shared_type_item | shared_type_item; shared_type_item: KLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_KLINE; } | UNKLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNKLINE; } | T_DLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_DLINE; } | T_UNDLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNDLINE; } | XLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_XLINE; } | T_UNXLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNXLINE; } | RESV { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_RESV; } | T_UNRESV { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNRESV; } | T_LOCOPS { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_LOCOPS; } | T_ALL { if (conf_parser_ctx.pass == 2) block_state.flags.value = SHARED_ALL; }; /*************************************************************************** * section cluster ***************************************************************************/ cluster_entry: T_CLUSTER { if (conf_parser_ctx.pass != 2) break; reset_block_state(); strlcpy(block_state.name.buf, "*", sizeof(block_state.name.buf)); block_state.flags.value = SHARED_ALL; } '{' cluster_items '}' ';' { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; conf = conf_make(CONF_CLUSTER); conf->flags = block_state.flags.value; conf->name = xstrdup(block_state.name.buf); }; cluster_items: cluster_items cluster_item | cluster_item; cluster_item: cluster_name | cluster_type | error ';' ; cluster_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; cluster_type: TYPE { if (conf_parser_ctx.pass == 2) block_state.flags.value = 0; } '=' cluster_types ';' ; cluster_types: cluster_types ',' cluster_type_item | cluster_type_item; cluster_type_item: KLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_KLINE; } | UNKLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNKLINE; } | T_DLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_DLINE; } | T_UNDLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNDLINE; } | XLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_XLINE; } | T_UNXLINE { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNXLINE; } | RESV { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_RESV; } | T_UNRESV { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_UNRESV; } | T_LOCOPS { if (conf_parser_ctx.pass == 2) block_state.flags.value |= SHARED_LOCOPS; } | T_ALL { if (conf_parser_ctx.pass == 2) block_state.flags.value = SHARED_ALL; }; /*************************************************************************** * section connect ***************************************************************************/ connect_entry: CONNECT { if (conf_parser_ctx.pass != 2) break; reset_block_state(); block_state.aftype.value = AF_INET; block_state.port.value = PORTNUM; } '{' connect_items '}' ';' { struct MaskItem *conf = NULL; struct addrinfo hints, *res; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0] || !block_state.host.buf[0]) break; if (!block_state.rpass.buf[0] || !block_state.spass.buf[0]) break; if (has_wildcards(block_state.name.buf) || has_wildcards(block_state.host.buf)) break; conf = conf_make(CONF_SERVER); conf->port = block_state.port.value; conf->flags = block_state.flags.value; conf->aftype = block_state.aftype.value; conf->host = xstrdup(block_state.host.buf); conf->name = xstrdup(block_state.name.buf); conf->passwd = xstrdup(block_state.rpass.buf); conf->spasswd = xstrdup(block_state.spass.buf); if (block_state.cert.buf[0]) conf->certfp = xstrdup(block_state.cert.buf); if (block_state.ciph.buf[0]) conf->cipher_list = xstrdup(block_state.ciph.buf); dlinkMoveList(&block_state.leaf.list, &conf->leaf_list); dlinkMoveList(&block_state.hub.list, &conf->hub_list); if (block_state.bind.buf[0]) { memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(block_state.bind.buf, NULL, &hints, &res)) ilog(LOG_TYPE_IRCD, "Invalid netmask for server vhost(%s)", block_state.bind.buf); else { assert(res != NULL); memcpy(&conf->bind, res->ai_addr, res->ai_addrlen); conf->bind.ss.ss_family = res->ai_family; conf->bind.ss_len = res->ai_addrlen; freeaddrinfo(res); } } conf_add_class_to_conf(conf, block_state.class.buf); lookup_confhost(conf); }; connect_items: connect_items connect_item | connect_item; connect_item: connect_name | connect_host | connect_vhost | connect_send_password | connect_accept_password | connect_ssl_certificate_fingerprint | connect_aftype | connect_port | connect_ssl_cipher_list | connect_flags | connect_hub_mask | connect_leaf_mask | connect_class | connect_encrypted | error ';' ; connect_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; connect_host: HOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.host.buf, yylval.string, sizeof(block_state.host.buf)); }; connect_vhost: VHOST '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.bind.buf, yylval.string, sizeof(block_state.bind.buf)); }; connect_send_password: SEND_PASSWORD '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; if ($3[0] == ':') conf_error_report("Server passwords cannot begin with a colon"); else if (strchr($3, ' ') != NULL) conf_error_report("Server passwords cannot contain spaces"); else strlcpy(block_state.spass.buf, yylval.string, sizeof(block_state.spass.buf)); }; connect_accept_password: ACCEPT_PASSWORD '=' QSTRING ';' { if (conf_parser_ctx.pass != 2) break; if ($3[0] == ':') conf_error_report("Server passwords cannot begin with a colon"); else if (strchr($3, ' ') != NULL) conf_error_report("Server passwords cannot contain spaces"); else strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; connect_ssl_certificate_fingerprint: SSL_CERTIFICATE_FINGERPRINT '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.cert.buf, yylval.string, sizeof(block_state.cert.buf)); }; connect_port: PORT '=' NUMBER ';' { if (conf_parser_ctx.pass == 2) block_state.port.value = $3; }; connect_aftype: AFTYPE '=' T_IPV4 ';' { if (conf_parser_ctx.pass == 2) block_state.aftype.value = AF_INET; } | AFTYPE '=' T_IPV6 ';' { #ifdef IPV6 if (conf_parser_ctx.pass == 2) block_state.aftype.value = AF_INET6; #endif }; connect_flags: IRCD_FLAGS { block_state.flags.value &= CONF_FLAGS_ENCRYPTED; } '=' connect_flags_items ';'; connect_flags_items: connect_flags_items ',' connect_flags_item | connect_flags_item; connect_flags_item: AUTOCONN { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_ALLOW_AUTO_CONN; } | T_SSL { if (conf_parser_ctx.pass == 2) block_state.flags.value |= CONF_FLAGS_SSL; }; connect_encrypted: ENCRYPTED '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) { if (yylval.number) block_state.flags.value |= CONF_FLAGS_ENCRYPTED; else block_state.flags.value &= ~CONF_FLAGS_ENCRYPTED; } }; connect_hub_mask: HUB_MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.hub.list); }; connect_leaf_mask: LEAF_MASK '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) dlinkAdd(xstrdup(yylval.string), make_dlink_node(), &block_state.leaf.list); }; connect_class: CLASS '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)); }; connect_ssl_cipher_list: T_SSL_CIPHER_LIST '=' QSTRING ';' { #ifdef HAVE_LIBCRYPTO if (conf_parser_ctx.pass == 2) strlcpy(block_state.ciph.buf, yylval.string, sizeof(block_state.ciph.buf)); #else if (conf_parser_ctx.pass == 2) conf_error_report("Ignoring connect::ciphers -- no OpenSSL support"); #endif }; /*************************************************************************** * section kill ***************************************************************************/ kill_entry: KILL { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' kill_items '}' ';' { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.user.buf[0] || !block_state.host.buf[0]) break; conf = conf_make(CONF_KLINE); conf->user = xstrdup(block_state.user.buf); conf->host = xstrdup(block_state.host.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_KLINE, conf); }; kill_items: kill_items kill_item | kill_item; kill_item: kill_user | kill_reason | error; kill_user: USER '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { struct split_nuh_item nuh; nuh.nuhmask = yylval.string; nuh.nickptr = NULL; nuh.userptr = block_state.user.buf; nuh.hostptr = block_state.host.buf; nuh.nicksize = 0; nuh.usersize = sizeof(block_state.user.buf); nuh.hostsize = sizeof(block_state.host.buf); split_nuh(&nuh); } }; kill_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; /*************************************************************************** * section deny ***************************************************************************/ deny_entry: DENY { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' deny_items '}' ';' { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.addr.buf[0]) break; if (parse_netmask(block_state.addr.buf, NULL, NULL) != HM_HOST) { conf = conf_make(CONF_DLINE); conf->host = xstrdup(block_state.addr.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); add_conf_by_address(CONF_DLINE, conf); } }; deny_items: deny_items deny_item | deny_item; deny_item: deny_ip | deny_reason | error; deny_ip: IP '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.addr.buf, yylval.string, sizeof(block_state.addr.buf)); }; deny_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; /*************************************************************************** * section exempt ***************************************************************************/ exempt_entry: EXEMPT '{' exempt_items '}' ';'; exempt_items: exempt_items exempt_item | exempt_item; exempt_item: exempt_ip | error; exempt_ip: IP '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { if (yylval.string[0] && parse_netmask(yylval.string, NULL, NULL) != HM_HOST) { struct MaskItem *conf = conf_make(CONF_EXEMPT); conf->host = xstrdup(yylval.string); add_conf_by_address(CONF_EXEMPT, conf); } } }; /*************************************************************************** * section gecos ***************************************************************************/ gecos_entry: GECOS { if (conf_parser_ctx.pass == 2) reset_block_state(); } '{' gecos_items '}' ';' { struct MaskItem *conf = NULL; if (conf_parser_ctx.pass != 2) break; if (!block_state.name.buf[0]) break; conf = conf_make(CONF_XLINE); conf->name = xstrdup(block_state.name.buf); if (block_state.rpass.buf[0]) conf->reason = xstrdup(block_state.rpass.buf); else conf->reason = xstrdup(CONF_NOREASON); }; gecos_items: gecos_items gecos_item | gecos_item; gecos_item: gecos_name | gecos_reason | error; gecos_name: NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.name.buf, yylval.string, sizeof(block_state.name.buf)); }; gecos_reason: REASON '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) strlcpy(block_state.rpass.buf, yylval.string, sizeof(block_state.rpass.buf)); }; /*************************************************************************** * section general ***************************************************************************/ general_entry: GENERAL '{' general_items '}' ';'; general_items: general_items general_item | general_item; general_item: general_hide_spoof_ips | general_ignore_bogus_ts | general_failed_oper_notice | general_anti_nick_flood | general_max_nick_time | general_max_nick_changes | general_max_accept | general_anti_spam_exit_message_time | general_ts_warn_delta | general_ts_max_delta | general_kill_chase_time_limit | general_invisible_on_connect | general_warn_no_nline | general_dots_in_ident | general_stats_o_oper_only | general_stats_k_oper_only | general_pace_wait | general_stats_i_oper_only | general_pace_wait_simple | general_stats_P_oper_only | general_stats_u_oper_only | general_short_motd | general_no_oper_flood | general_true_no_oper_flood | general_oper_pass_resv | general_oper_only_umodes | general_max_targets | general_use_egd | general_egdpool_path | general_oper_umodes | general_caller_id_wait | general_opers_bypass_callerid | general_default_floodcount | general_min_nonwildcard | general_min_nonwildcard_simple | general_throttle_time | general_havent_read_conf | general_ping_cookie | general_disable_auth | general_tkline_expire_notices | general_gline_enable | general_gline_duration | general_gline_request_duration | general_gline_min_cidr | general_gline_min_cidr6 | general_stats_e_disabled | general_max_watch | general_services_name | general_cycle_on_host_change | error; general_max_watch: MAX_WATCH '=' NUMBER ';' { ConfigFileEntry.max_watch = $3; }; general_cycle_on_host_change: CYCLE_ON_HOST_CHANGE '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigFileEntry.cycle_on_host_change = yylval.number; }; general_gline_enable: GLINE_ENABLE '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigFileEntry.glines = yylval.number; }; general_gline_duration: GLINE_DURATION '=' timespec ';' { if (conf_parser_ctx.pass == 2) ConfigFileEntry.gline_time = $3; }; general_gline_request_duration: GLINE_REQUEST_DURATION '=' timespec ';' { if (conf_parser_ctx.pass == 2) ConfigFileEntry.gline_request_time = $3; }; general_gline_min_cidr: GLINE_MIN_CIDR '=' NUMBER ';' { ConfigFileEntry.gline_min_cidr = $3; }; general_gline_min_cidr6: GLINE_MIN_CIDR6 '=' NUMBER ';' { ConfigFileEntry.gline_min_cidr6 = $3; }; general_tkline_expire_notices: TKLINE_EXPIRE_NOTICES '=' TBOOL ';' { ConfigFileEntry.tkline_expire_notices = yylval.number; }; general_kill_chase_time_limit: KILL_CHASE_TIME_LIMIT '=' timespec ';' { ConfigFileEntry.kill_chase_time_limit = $3; }; general_hide_spoof_ips: HIDE_SPOOF_IPS '=' TBOOL ';' { ConfigFileEntry.hide_spoof_ips = yylval.number; }; general_ignore_bogus_ts: IGNORE_BOGUS_TS '=' TBOOL ';' { ConfigFileEntry.ignore_bogus_ts = yylval.number; }; general_failed_oper_notice: FAILED_OPER_NOTICE '=' TBOOL ';' { ConfigFileEntry.failed_oper_notice = yylval.number; }; general_anti_nick_flood: ANTI_NICK_FLOOD '=' TBOOL ';' { ConfigFileEntry.anti_nick_flood = yylval.number; }; general_max_nick_time: MAX_NICK_TIME '=' timespec ';' { ConfigFileEntry.max_nick_time = $3; }; general_max_nick_changes: MAX_NICK_CHANGES '=' NUMBER ';' { ConfigFileEntry.max_nick_changes = $3; }; general_max_accept: MAX_ACCEPT '=' NUMBER ';' { ConfigFileEntry.max_accept = $3; }; general_anti_spam_exit_message_time: ANTI_SPAM_EXIT_MESSAGE_TIME '=' timespec ';' { ConfigFileEntry.anti_spam_exit_message_time = $3; }; general_ts_warn_delta: TS_WARN_DELTA '=' timespec ';' { ConfigFileEntry.ts_warn_delta = $3; }; general_ts_max_delta: TS_MAX_DELTA '=' timespec ';' { if (conf_parser_ctx.pass == 2) ConfigFileEntry.ts_max_delta = $3; }; general_havent_read_conf: HAVENT_READ_CONF '=' NUMBER ';' { if (($3 > 0) && conf_parser_ctx.pass == 1) { ilog(LOG_TYPE_IRCD, "You haven't read your config file properly."); ilog(LOG_TYPE_IRCD, "There is a line in the example conf that will kill your server if not removed."); ilog(LOG_TYPE_IRCD, "Consider actually reading/editing the conf file, and removing this line."); exit(0); } }; general_invisible_on_connect: INVISIBLE_ON_CONNECT '=' TBOOL ';' { ConfigFileEntry.invisible_on_connect = yylval.number; }; general_warn_no_nline: WARN_NO_NLINE '=' TBOOL ';' { ConfigFileEntry.warn_no_nline = yylval.number; }; general_stats_e_disabled: STATS_E_DISABLED '=' TBOOL ';' { ConfigFileEntry.stats_e_disabled = yylval.number; }; general_stats_o_oper_only: STATS_O_OPER_ONLY '=' TBOOL ';' { ConfigFileEntry.stats_o_oper_only = yylval.number; }; general_stats_P_oper_only: STATS_P_OPER_ONLY '=' TBOOL ';' { ConfigFileEntry.stats_P_oper_only = yylval.number; }; general_stats_u_oper_only: STATS_U_OPER_ONLY '=' TBOOL ';' { ConfigFileEntry.stats_u_oper_only = yylval.number; }; general_stats_k_oper_only: STATS_K_OPER_ONLY '=' TBOOL ';' { ConfigFileEntry.stats_k_oper_only = 2 * yylval.number; } | STATS_K_OPER_ONLY '=' TMASKED ';' { ConfigFileEntry.stats_k_oper_only = 1; }; general_stats_i_oper_only: STATS_I_OPER_ONLY '=' TBOOL ';' { ConfigFileEntry.stats_i_oper_only = 2 * yylval.number; } | STATS_I_OPER_ONLY '=' TMASKED ';' { ConfigFileEntry.stats_i_oper_only = 1; }; general_pace_wait: PACE_WAIT '=' timespec ';' { ConfigFileEntry.pace_wait = $3; }; general_caller_id_wait: CALLER_ID_WAIT '=' timespec ';' { ConfigFileEntry.caller_id_wait = $3; }; general_opers_bypass_callerid: OPERS_BYPASS_CALLERID '=' TBOOL ';' { ConfigFileEntry.opers_bypass_callerid = yylval.number; }; general_pace_wait_simple: PACE_WAIT_SIMPLE '=' timespec ';' { ConfigFileEntry.pace_wait_simple = $3; }; general_short_motd: SHORT_MOTD '=' TBOOL ';' { ConfigFileEntry.short_motd = yylval.number; }; general_no_oper_flood: NO_OPER_FLOOD '=' TBOOL ';' { ConfigFileEntry.no_oper_flood = yylval.number; }; general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TBOOL ';' { ConfigFileEntry.true_no_oper_flood = yylval.number; }; general_oper_pass_resv: OPER_PASS_RESV '=' TBOOL ';' { ConfigFileEntry.oper_pass_resv = yylval.number; }; general_dots_in_ident: DOTS_IN_IDENT '=' NUMBER ';' { ConfigFileEntry.dots_in_ident = $3; }; general_max_targets: MAX_TARGETS '=' NUMBER ';' { ConfigFileEntry.max_targets = $3; }; general_use_egd: USE_EGD '=' TBOOL ';' { ConfigFileEntry.use_egd = yylval.number; }; general_egdpool_path: EGDPOOL_PATH '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { MyFree(ConfigFileEntry.egdpool_path); ConfigFileEntry.egdpool_path = xstrdup(yylval.string); } }; general_services_name: T_SERVICES_NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string)) { MyFree(ConfigFileEntry.service_name); ConfigFileEntry.service_name = xstrdup(yylval.string); } }; general_ping_cookie: PING_COOKIE '=' TBOOL ';' { ConfigFileEntry.ping_cookie = yylval.number; }; general_disable_auth: DISABLE_AUTH '=' TBOOL ';' { ConfigFileEntry.disable_auth = yylval.number; }; general_throttle_time: THROTTLE_TIME '=' timespec ';' { ConfigFileEntry.throttle_time = yylval.number; }; general_oper_umodes: OPER_UMODES { ConfigFileEntry.oper_umodes = 0; } '=' umode_oitems ';' ; umode_oitems: umode_oitems ',' umode_oitem | umode_oitem; umode_oitem: T_BOTS { ConfigFileEntry.oper_umodes |= UMODE_BOTS; } | T_CCONN { ConfigFileEntry.oper_umodes |= UMODE_CCONN; } | T_DEAF { ConfigFileEntry.oper_umodes |= UMODE_DEAF; } | T_DEBUG { ConfigFileEntry.oper_umodes |= UMODE_DEBUG; } | T_FULL { ConfigFileEntry.oper_umodes |= UMODE_FULL; } | HIDDEN { ConfigFileEntry.oper_umodes |= UMODE_HIDDEN; } | T_SKILL { ConfigFileEntry.oper_umodes |= UMODE_SKILL; } | T_NCHANGE { ConfigFileEntry.oper_umodes |= UMODE_NCHANGE; } | T_REJ { ConfigFileEntry.oper_umodes |= UMODE_REJ; } | T_UNAUTH { ConfigFileEntry.oper_umodes |= UMODE_UNAUTH; } | T_SPY { ConfigFileEntry.oper_umodes |= UMODE_SPY; } | T_EXTERNAL { ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL; } | T_OPERWALL { ConfigFileEntry.oper_umodes |= UMODE_OPERWALL; } | T_SERVNOTICE { ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE; } | T_INVISIBLE { ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE; } | T_WALLOP { ConfigFileEntry.oper_umodes |= UMODE_WALLOP; } | T_SOFTCALLERID { ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID; } | T_CALLERID { ConfigFileEntry.oper_umodes |= UMODE_CALLERID; } | T_LOCOPS { ConfigFileEntry.oper_umodes |= UMODE_LOCOPS; } | T_NONONREG { ConfigFileEntry.oper_umodes |= UMODE_REGONLY; } | T_FARCONNECT { ConfigFileEntry.oper_umodes |= UMODE_FARCONNECT; }; general_oper_only_umodes: OPER_ONLY_UMODES { ConfigFileEntry.oper_only_umodes = 0; } '=' umode_items ';' ; umode_items: umode_items ',' umode_item | umode_item; umode_item: T_BOTS { ConfigFileEntry.oper_only_umodes |= UMODE_BOTS; } | T_CCONN { ConfigFileEntry.oper_only_umodes |= UMODE_CCONN; } | T_DEAF { ConfigFileEntry.oper_only_umodes |= UMODE_DEAF; } | T_DEBUG { ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG; } | T_FULL { ConfigFileEntry.oper_only_umodes |= UMODE_FULL; } | T_SKILL { ConfigFileEntry.oper_only_umodes |= UMODE_SKILL; } | HIDDEN { ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN; } | T_NCHANGE { ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE; } | T_REJ { ConfigFileEntry.oper_only_umodes |= UMODE_REJ; } | T_UNAUTH { ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH; } | T_SPY { ConfigFileEntry.oper_only_umodes |= UMODE_SPY; } | T_EXTERNAL { ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL; } | T_OPERWALL { ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL; } | T_SERVNOTICE { ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE; } | T_INVISIBLE { ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE; } | T_WALLOP { ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP; } | T_SOFTCALLERID { ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID; } | T_CALLERID { ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID; } | T_LOCOPS { ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS; } | T_NONONREG { ConfigFileEntry.oper_only_umodes |= UMODE_REGONLY; } | T_FARCONNECT { ConfigFileEntry.oper_only_umodes |= UMODE_FARCONNECT; }; general_min_nonwildcard: MIN_NONWILDCARD '=' NUMBER ';' { ConfigFileEntry.min_nonwildcard = $3; }; general_min_nonwildcard_simple: MIN_NONWILDCARD_SIMPLE '=' NUMBER ';' { ConfigFileEntry.min_nonwildcard_simple = $3; }; general_default_floodcount: DEFAULT_FLOODCOUNT '=' NUMBER ';' { ConfigFileEntry.default_floodcount = $3; }; /*************************************************************************** * section channel ***************************************************************************/ channel_entry: CHANNEL '{' channel_items '}' ';'; channel_items: channel_items channel_item | channel_item; channel_item: channel_max_bans | channel_knock_delay | channel_knock_delay_channel | channel_max_chans_per_user | channel_max_chans_per_oper | channel_default_split_user_count | channel_default_split_server_count | channel_no_create_on_split | channel_no_join_on_split | channel_jflood_count | channel_jflood_time | channel_disable_fake_channels | error; channel_disable_fake_channels: DISABLE_FAKE_CHANNELS '=' TBOOL ';' { ConfigChannel.disable_fake_channels = yylval.number; }; channel_knock_delay: KNOCK_DELAY '=' timespec ';' { ConfigChannel.knock_delay = $3; }; channel_knock_delay_channel: KNOCK_DELAY_CHANNEL '=' timespec ';' { ConfigChannel.knock_delay_channel = $3; }; channel_max_chans_per_user: MAX_CHANS_PER_USER '=' NUMBER ';' { ConfigChannel.max_chans_per_user = $3; }; channel_max_chans_per_oper: MAX_CHANS_PER_OPER '=' NUMBER ';' { ConfigChannel.max_chans_per_oper = $3; }; channel_max_bans: MAX_BANS '=' NUMBER ';' { ConfigChannel.max_bans = $3; }; channel_default_split_user_count: DEFAULT_SPLIT_USER_COUNT '=' NUMBER ';' { ConfigChannel.default_split_user_count = $3; }; channel_default_split_server_count: DEFAULT_SPLIT_SERVER_COUNT '=' NUMBER ';' { ConfigChannel.default_split_server_count = $3; }; channel_no_create_on_split: NO_CREATE_ON_SPLIT '=' TBOOL ';' { ConfigChannel.no_create_on_split = yylval.number; }; channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TBOOL ';' { ConfigChannel.no_join_on_split = yylval.number; }; channel_jflood_count: JOIN_FLOOD_COUNT '=' NUMBER ';' { GlobalSetOptions.joinfloodcount = yylval.number; }; channel_jflood_time: JOIN_FLOOD_TIME '=' timespec ';' { GlobalSetOptions.joinfloodtime = yylval.number; }; /*************************************************************************** * section serverhide ***************************************************************************/ serverhide_entry: SERVERHIDE '{' serverhide_items '}' ';'; serverhide_items: serverhide_items serverhide_item | serverhide_item; serverhide_item: serverhide_flatten_links | serverhide_disable_remote_commands | serverhide_hide_servers | serverhide_hide_services | serverhide_links_delay | serverhide_hidden | serverhide_hidden_name | serverhide_hide_server_ips | error; serverhide_flatten_links: FLATTEN_LINKS '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.flatten_links = yylval.number; }; serverhide_disable_remote_commands: DISABLE_REMOTE_COMMANDS '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.disable_remote_commands = yylval.number; }; serverhide_hide_servers: HIDE_SERVERS '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_servers = yylval.number; }; serverhide_hide_services: HIDE_SERVICES '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_services = yylval.number; }; serverhide_hidden_name: HIDDEN_NAME '=' QSTRING ';' { if (conf_parser_ctx.pass == 2) { MyFree(ConfigServerHide.hidden_name); ConfigServerHide.hidden_name = xstrdup(yylval.string); } }; serverhide_links_delay: LINKS_DELAY '=' timespec ';' { if (conf_parser_ctx.pass == 2) { if (($3 > 0) && ConfigServerHide.links_disabled == 1) { eventAddIsh("write_links_file", write_links_file, NULL, $3); ConfigServerHide.links_disabled = 0; } ConfigServerHide.links_delay = $3; } }; serverhide_hidden: HIDDEN '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.hidden = yylval.number; }; serverhide_hide_server_ips: HIDE_SERVER_IPS '=' TBOOL ';' { if (conf_parser_ctx.pass == 2) ConfigServerHide.hide_server_ips = yylval.number; }; ircd-hybrid-8.1.13.dfsg.1/src/s_auth.c0000644000175000017500000003562412263053413015434 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_auth.c: Functions for querying a users ident. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_auth.c 2180 2013-06-04 10:55:19Z michael $ */ /* * Changes: * July 6, 1999 - Rewrote most of the code here. When a client connects * to the server and passes initial socket validation checks, it * is owned by this module (auth) which returns it to the rest of the * server when dns and auth queries are finished. Until the client is * released, the server does not know it exists and does not process * any messages from it. * --Bleep Thomas Helvey */ #include "stdinc.h" #include "list.h" #include "ircd_defs.h" #include "fdlist.h" #include "s_auth.h" #include "conf.h" #include "client.h" #include "event.h" #include "hook.h" #include "irc_string.h" #include "ircd.h" #include "packet.h" #include "irc_res.h" #include "s_bsd.h" #include "log.h" #include "send.h" #include "mempool.h" static const char *HeaderMessages[] = { ":%s NOTICE AUTH :*** Looking up your hostname...", ":%s NOTICE AUTH :*** Found your hostname", ":%s NOTICE AUTH :*** Couldn't look up your hostname", ":%s NOTICE AUTH :*** Checking Ident", ":%s NOTICE AUTH :*** Got Ident response", ":%s NOTICE AUTH :*** No Ident response", ":%s NOTICE AUTH :*** Your forward and reverse DNS do not match, ignoring hostname.", ":%s NOTICE AUTH :*** Your hostname is too long, ignoring hostname" }; enum { REPORT_DO_DNS, REPORT_FIN_DNS, REPORT_FAIL_DNS, REPORT_DO_ID, REPORT_FIN_ID, REPORT_FAIL_ID, REPORT_IP_MISMATCH, REPORT_HOST_TOOLONG }; #define sendheader(c, i) sendto_one((c), HeaderMessages[(i)], me.name) static dlink_list auth_doing_list = { NULL, NULL, 0 }; static EVH timeout_auth_queries_event; static PF read_auth_reply; static CNCB auth_connect_callback; /* auth_init * * Initialise the auth code */ void auth_init(void) { eventAddIsh("timeout_auth_queries_event", timeout_auth_queries_event, NULL, 1); } /* * make_auth_request - allocate a new auth request */ static struct AuthRequest * make_auth_request(struct Client *client) { struct AuthRequest *request = &client->localClient->auth; memset(request, 0, sizeof(*request)); request->client = client; request->timeout = CurrentTime + CONNECTTIMEOUT; return request; } /* * release_auth_client - release auth client from auth system * this adds the client into the local client lists so it can be read by * the main io processing loop */ void release_auth_client(struct AuthRequest *auth) { struct Client *client = auth->client; if (IsDoingAuth(auth) || IsDNSPending(auth)) return; if (dlinkFind(&auth_doing_list, auth)) dlinkDelete(&auth->node, &auth_doing_list); /* * When a client has auth'ed, we want to start reading what it sends * us. This is what read_packet() does. * -- adrian */ client->localClient->allow_read = MAX_FLOOD; comm_setflush(&client->localClient->fd, 1000, flood_recalc, client); dlinkAdd(client, &client->node, &global_client_list); client->localClient->since = CurrentTime; client->localClient->lasttime = CurrentTime; client->localClient->firsttime = CurrentTime; client->flags |= FLAGS_FINISHED_AUTH; read_packet(&client->localClient->fd, client); } /* * auth_dns_callback - called when resolver query finishes * if the query resulted in a successful search, name will contain * a non-NULL pointer, otherwise name will be NULL. * set the client on it's way to a connection completion, regardless * of success of failure */ static void auth_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) { struct AuthRequest *auth = vptr; ClearDNSPending(auth); if (name != NULL) { const struct sockaddr_in *v4, *v4dns; #ifdef IPV6 const struct sockaddr_in6 *v6, *v6dns; #endif int good = 1; #ifdef IPV6 if (auth->client->localClient->ip.ss.ss_family == AF_INET6) { v6 = (const struct sockaddr_in6 *)&auth->client->localClient->ip; v6dns = (const struct sockaddr_in6 *)addr; if (memcmp(&v6->sin6_addr, &v6dns->sin6_addr, sizeof(struct in6_addr)) != 0) { sendheader(auth->client, REPORT_IP_MISMATCH); good = 0; } } else #endif { v4 = (const struct sockaddr_in *)&auth->client->localClient->ip; v4dns = (const struct sockaddr_in *)addr; if(v4->sin_addr.s_addr != v4dns->sin_addr.s_addr) { sendheader(auth->client, REPORT_IP_MISMATCH); good = 0; } } if (good && strlen(name) <= HOSTLEN) { strlcpy(auth->client->host, name, sizeof(auth->client->host)); sendheader(auth->client, REPORT_FIN_DNS); } else if (strlen(name) > HOSTLEN) sendheader(auth->client, REPORT_HOST_TOOLONG); } else sendheader(auth->client, REPORT_FAIL_DNS); release_auth_client(auth); } /* * authsenderr - handle auth send errors */ static void auth_error(struct AuthRequest *auth) { ++ServerStats.is_abad; fd_close(&auth->fd); ClearAuth(auth); sendheader(auth->client, REPORT_FAIL_ID); release_auth_client(auth); } /* * start_auth_query - Flag the client to show that an attempt to * contact the ident server on * the client's host. The connect and subsequently the socket are all put * into 'non-blocking' mode. Should the connect or any later phase of the * identifing process fail, it is aborted and the user is given a username * of "unknown". */ static int start_auth_query(struct AuthRequest *auth) { struct irc_ssaddr localaddr; socklen_t locallen = sizeof(struct irc_ssaddr); #ifdef IPV6 struct sockaddr_in6 *v6; #else struct sockaddr_in *v4; #endif /* open a socket of the same type as the client socket */ if (comm_open(&auth->fd, auth->client->localClient->ip.ss.ss_family, SOCK_STREAM, 0, "ident") == -1) { report_error(L_ALL, "creating auth stream socket %s:%s", get_client_name(auth->client, SHOW_IP), errno); ilog(LOG_TYPE_IRCD, "Unable to create auth socket for %s", get_client_name(auth->client, SHOW_IP)); ++ServerStats.is_abad; return 0; } sendheader(auth->client, REPORT_DO_ID); /* * get the local address of the client and bind to that to * make the auth request. This used to be done only for * ifdef VIRTUAL_HOST, but needs to be done for all clients * since the ident request must originate from that same address-- * and machines with multiple IP addresses are common now */ memset(&localaddr, 0, locallen); getsockname(auth->client->localClient->fd.fd, (struct sockaddr*)&localaddr, &locallen); #ifdef IPV6 remove_ipv6_mapping(&localaddr); v6 = (struct sockaddr_in6 *)&localaddr; v6->sin6_port = htons(0); #else localaddr.ss_len = locallen; v4 = (struct sockaddr_in *)&localaddr; v4->sin_port = htons(0); #endif localaddr.ss_port = htons(0); comm_connect_tcp(&auth->fd, auth->client->sockhost, 113, (struct sockaddr *)&localaddr, localaddr.ss_len, auth_connect_callback, auth, auth->client->localClient->ip.ss.ss_family, GlobalSetOptions.ident_timeout); return 1; /* We suceed here for now */ } /* * GetValidIdent - parse ident query reply from identd server * * Inputs - pointer to ident buf * Output - NULL if no valid ident found, otherwise pointer to name * Side effects - */ /* * A few questions have been asked about this mess, obviously * it should have been commented better the first time. * The original idea was to remove all references to libc from ircd-hybrid. * Instead of having to write a replacement for sscanf(), I did a * rather gruseome parser here so we could remove this function call. * Note, that I had also removed a few floating point printfs as well (though * now we are still stuck with a few...) * Remember, we have a replacement ircd sprintf, we have bleeps fputs lib * it would have been nice to remove some unneeded code. * Oh well. If we don't remove libc stuff totally, then it would be * far cleaner to use sscanf() * * - Dianora */ static char * GetValidIdent(char *buf) { int remp = 0; int locp = 0; char* colon1Ptr; char* colon2Ptr; char* colon3Ptr; char* commaPtr; char* remotePortString; /* All this to get rid of a sscanf() fun. */ remotePortString = buf; if ((colon1Ptr = strchr(remotePortString,':')) == NULL) return 0; *colon1Ptr = '\0'; colon1Ptr++; if ((colon2Ptr = strchr(colon1Ptr,':')) == NULL) return 0; *colon2Ptr = '\0'; colon2Ptr++; if ((commaPtr = strchr(remotePortString, ',')) == NULL) return 0; *commaPtr = '\0'; commaPtr++; if ((remp = atoi(remotePortString)) == 0) return 0; if ((locp = atoi(commaPtr)) == 0) return 0; /* look for USERID bordered by first pair of colons */ if (strstr(colon1Ptr, "USERID") == NULL) return 0; if ((colon3Ptr = strchr(colon2Ptr,':')) == NULL) return 0; *colon3Ptr = '\0'; colon3Ptr++; return (colon3Ptr); } /* * start_auth * * inputs - pointer to client to auth * output - NONE * side effects - starts auth (identd) and dns queries for a client */ void start_auth(struct Client *client) { struct AuthRequest *auth = NULL; assert(client != NULL); auth = make_auth_request(client); dlinkAdd(auth, &auth->node, &auth_doing_list); sendheader(client, REPORT_DO_DNS); SetDNSPending(auth); if (ConfigFileEntry.disable_auth == 0) { SetDoingAuth(auth); start_auth_query(auth); } gethost_byaddr(auth_dns_callback, auth, &client->localClient->ip); } /* * timeout_auth_queries - timeout resolver and identd requests * allow clients through if requests failed */ static void timeout_auth_queries_event(void *notused) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, auth_doing_list.head) { struct AuthRequest *auth = ptr->data; if (auth->timeout > CurrentTime) continue; if (IsDoingAuth(auth)) { ++ServerStats.is_abad; fd_close(&auth->fd); ClearAuth(auth); sendheader(auth->client, REPORT_FAIL_ID); } if (IsDNSPending(auth)) { delete_resolver_queries(auth); ClearDNSPending(auth); sendheader(auth->client, REPORT_FAIL_DNS); } ilog(LOG_TYPE_IRCD, "DNS/AUTH timeout %s", get_client_name(auth->client, SHOW_IP)); release_auth_client(auth); } } /* * auth_connect_callback() - deal with the result of comm_connect_tcp() * * If the connection failed, we simply close the auth fd and report * a failure. If the connection suceeded send the ident server a query * giving "theirport , ourport". The write is only attempted *once* so * it is deemed to be a fail if the entire write doesn't write all the * data given. This shouldnt be a problem since the socket should have * a write buffer far greater than this message to store it in should * problems arise. -avalon */ static void auth_connect_callback(fde_t *fd, int error, void *data) { struct AuthRequest *auth = data; struct irc_ssaddr us; struct irc_ssaddr them; char authbuf[32]; socklen_t ulen = sizeof(struct irc_ssaddr); socklen_t tlen = sizeof(struct irc_ssaddr); uint16_t uport, tport; #ifdef IPV6 struct sockaddr_in6 *v6; #else struct sockaddr_in *v4; #endif if (error != COMM_OK) { auth_error(auth); return; } if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us, &ulen) || getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them, &tlen)) { ilog(LOG_TYPE_IRCD, "auth get{sock,peer}name error for %s", get_client_name(auth->client, SHOW_IP)); auth_error(auth); return; } #ifdef IPV6 v6 = (struct sockaddr_in6 *)&us; uport = ntohs(v6->sin6_port); v6 = (struct sockaddr_in6 *)&them; tport = ntohs(v6->sin6_port); remove_ipv6_mapping(&us); remove_ipv6_mapping(&them); #else v4 = (struct sockaddr_in *)&us; uport = ntohs(v4->sin_port); v4 = (struct sockaddr_in *)&them; tport = ntohs(v4->sin_port); us.ss_len = ulen; them.ss_len = tlen; #endif snprintf(authbuf, sizeof(authbuf), "%u , %u\r\n", tport, uport); if (send(fd->fd, authbuf, strlen(authbuf), 0) == -1) { auth_error(auth); return; } read_auth_reply(&auth->fd, auth); } /* * read_auth_reply - read the reply (if any) from the ident server * we connected to. * We only give it one shot, if the reply isn't good the first time * fail the authentication entirely. --Bleep */ #define AUTH_BUFSIZ 128 static void read_auth_reply(fde_t *fd, void *data) { struct AuthRequest *auth = data; char *s = NULL; char *t = NULL; int len; int count; char buf[AUTH_BUFSIZ + 1]; /* buffer to read auth reply into */ /* Why? * Well, recv() on many POSIX systems is a per-packet operation, * and we do not necessarily want this, because on lowspec machines, * the ident response may come back fragmented, thus resulting in an * invalid ident response, even if the ident response was really OK. * * So PLEASE do not change this code to recv without being aware of the * consequences. * * --nenolod */ len = read(fd->fd, buf, AUTH_BUFSIZ); if (len < 0) { if (ignoreErrno(errno)) comm_setselect(fd, COMM_SELECT_READ, read_auth_reply, auth, 0); else auth_error(auth); return; } if (len > 0) { buf[len] = '\0'; if ((s = GetValidIdent(buf))) { t = auth->client->username; while (*s == '~' || *s == '^') s++; for (count = USERLEN; *s && count; s++) { if (*s == '@') break; if (!IsSpace(*s) && *s != ':' && *s != '[') { *t++ = *s; count--; } } *t = '\0'; } } fd_close(fd); ClearAuth(auth); if (s == NULL) { sendheader(auth->client, REPORT_FAIL_ID); ++ServerStats.is_abad; } else { sendheader(auth->client, REPORT_FIN_ID); ++ServerStats.is_asuc; SetGotId(auth->client); } release_auth_client(auth); } /* * delete_auth() */ void delete_auth(struct AuthRequest *auth) { if (IsDNSPending(auth)) delete_resolver_queries(auth); if (IsDoingAuth(auth)) fd_close(&auth->fd); if (dlinkFind(&auth_doing_list, auth)) dlinkDelete(&auth->node, &auth_doing_list); } ircd-hybrid-8.1.13.dfsg.1/src/conf_class.c0000644000175000017500000002077012263053413016257 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file * \brief Configuration managment for class{} blocks * \version $Id: conf_class.c 2214 2013-06-05 22:26:06Z michael $ */ #include "stdinc.h" #include "list.h" #include "ircd.h" #include "conf.h" #include "hostmask.h" #include "irc_string.h" #include "memory.h" struct ClassItem *class_default; static dlink_list class_list = { NULL, NULL, 0 }; const dlink_list * class_get_list(void) { return &class_list; } struct ClassItem * class_make(void) { struct ClassItem *class = MyMalloc(sizeof(*class)); class->active = 1; class->con_freq = DEFAULT_CONNECTFREQUENCY; class->ping_freq = DEFAULT_PINGFREQUENCY; class->max_total = MAXIMUM_LINKS_DEFAULT; class->max_sendq = DEFAULT_SENDQ; class->max_recvq = DEFAULT_RECVQ; dlinkAdd(class, &class->node, &class_list); return class; } void class_free(struct ClassItem *class) { assert(class); assert(class->active == 0); assert(class->ref_count == 0); dlinkDelete(&class->node, &class_list); MyFree(class->name); MyFree(class); } void class_init(void) { (class_default = class_make())->name = xstrdup("default"); } struct ClassItem * get_class_ptr(const dlink_list *const list) { const dlink_node *ptr = NULL; if ((ptr = list->head)) { const struct MaskItem *conf = ptr->data; assert(conf->class); assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); return conf->class; } return class_default; } const char * get_client_class(const dlink_list *const list) { const dlink_node *ptr = NULL; if ((ptr = list->head)) { const struct MaskItem *conf = ptr->data; assert(conf->class); assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); return conf->class->name; } return class_default->name; } unsigned int get_client_ping(const dlink_list *const list) { const dlink_node *ptr = NULL; if ((ptr = list->head)) { const struct MaskItem *conf = ptr->data; assert(conf->class); assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); return conf->class->ping_freq; } return class_default->ping_freq; } unsigned int get_sendq(const dlink_list *const list) { const dlink_node *ptr = NULL; if ((ptr = list->head)) { const struct MaskItem *conf = ptr->data; assert(conf->class); assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); return conf->class->max_sendq; } return class_default->max_sendq; } unsigned int get_recvq(const dlink_list *const list) { const dlink_node *ptr = NULL; if ((ptr = list->head)) { const struct MaskItem *conf = ptr->data; assert(conf->class); assert(conf->type & (CONF_OPER | CONF_CLIENT | CONF_SERVER)); return conf->class->max_recvq; } return class_default->max_recvq; } /* * inputs - Integer (Number of class) * output - Pointer to ClassItem struct. Non-NULL expected * side effects - NONE */ struct ClassItem * class_find(const char *name, int active) { dlink_node *ptr = NULL; DLINK_FOREACH(ptr, class_list.head) { struct ClassItem *class = ptr->data; if (!irccmp(class->name, name)) return active && !class->active ? NULL : class; } return NULL; } /* * We don't delete the class table, rather mark all entries for deletion. * The table is cleaned up by delete_marked_classes. - avalon */ void class_mark_for_deletion(void) { dlink_node *ptr = NULL; DLINK_FOREACH_PREV(ptr, class_list.tail->prev) ((struct ClassItem *)ptr->data)->active = 0; } void class_delete_marked(void) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, class_list.head) { struct ClassItem *class = ptr->data; if (!class->active && !class->ref_count) { destroy_cidr_class(class); class_free(class); } } } /* * cidr_limit_reached * * inputs - int flag allowing over_rule of limits * - pointer to the ip to be added * - pointer to the class * output - non zero if limit reached * 0 if limit not reached * side effects - */ int cidr_limit_reached(int over_rule, struct irc_ssaddr *ip, struct ClassItem *class) { dlink_node *ptr = NULL; struct CidrItem *cidr = NULL; if (class->number_per_cidr == 0) return 0; if (ip->ss.ss_family == AF_INET) { if (class->cidr_bitlen_ipv4 == 0) return 0; DLINK_FOREACH(ptr, class->list_ipv4.head) { cidr = ptr->data; if (match_ipv4(ip, &cidr->mask, class->cidr_bitlen_ipv4)) { if (!over_rule && (cidr->number_on_this_cidr >= class->number_per_cidr)) return -1; cidr->number_on_this_cidr++; return 0; } } cidr = MyMalloc(sizeof(struct CidrItem)); cidr->number_on_this_cidr = 1; cidr->mask = *ip; mask_addr(&cidr->mask, class->cidr_bitlen_ipv4); dlinkAdd(cidr, &cidr->node, &class->list_ipv4); } #ifdef IPV6 else if (class->cidr_bitlen_ipv6 > 0) { DLINK_FOREACH(ptr, class->list_ipv6.head) { cidr = ptr->data; if (match_ipv6(ip, &cidr->mask, class->cidr_bitlen_ipv6)) { if (!over_rule && (cidr->number_on_this_cidr >= class->number_per_cidr)) return -1; cidr->number_on_this_cidr++; return 0; } } cidr = MyMalloc(sizeof(struct CidrItem)); cidr->number_on_this_cidr = 1; cidr->mask = *ip; mask_addr(&cidr->mask, class->cidr_bitlen_ipv6); dlinkAdd(cidr, &cidr->node, &class->list_ipv6); } #endif return 0; } /* * remove_from_cidr_check * * inputs - pointer to the ip to be removed * - pointer to the class * output - NONE * side effects - */ void remove_from_cidr_check(struct irc_ssaddr *ip, struct ClassItem *aclass) { dlink_node *ptr = NULL; dlink_node *next_ptr = NULL; struct CidrItem *cidr; if (aclass->number_per_cidr == 0) return; if (ip->ss.ss_family == AF_INET) { if (aclass->cidr_bitlen_ipv4 == 0) return; DLINK_FOREACH_SAFE(ptr, next_ptr, aclass->list_ipv4.head) { cidr = ptr->data; if (match_ipv4(ip, &cidr->mask, aclass->cidr_bitlen_ipv4)) { cidr->number_on_this_cidr--; if (cidr->number_on_this_cidr == 0) { dlinkDelete(ptr, &aclass->list_ipv4); MyFree(cidr); return; } } } } #ifdef IPV6 else if (aclass->cidr_bitlen_ipv6 > 0) { DLINK_FOREACH_SAFE(ptr, next_ptr, aclass->list_ipv6.head) { cidr = ptr->data; if (match_ipv6(ip, &cidr->mask, aclass->cidr_bitlen_ipv6)) { cidr->number_on_this_cidr--; if (cidr->number_on_this_cidr == 0) { dlinkDelete(ptr, &aclass->list_ipv6); MyFree(cidr); return; } } } } #endif } void rebuild_cidr_list(struct ClassItem *class) { dlink_node *ptr; destroy_cidr_class(class); DLINK_FOREACH(ptr, local_client_list.head) { struct Client *client_p = ptr->data; struct MaskItem *conf = client_p->localClient->confs.tail->data; if (conf && (conf->type == CONF_CLIENT)) if (conf->class == class) cidr_limit_reached(1, &client_p->localClient->ip, class); } } /* * destroy_cidr_list * * inputs - pointer to class dlink list of cidr blocks * output - none * side effects - completely destroys the class link list of cidr blocks */ static void destroy_cidr_list(dlink_list *list) { dlink_node *ptr = NULL, *next_ptr = NULL; DLINK_FOREACH_SAFE(ptr, next_ptr, list->head) { dlinkDelete(ptr, list); MyFree(ptr->data); } } /* * destroy_cidr_class * * inputs - pointer to class * output - none * side effects - completely destroys the class link list of cidr blocks */ void destroy_cidr_class(struct ClassItem *class) { destroy_cidr_list(&class->list_ipv4); destroy_cidr_list(&class->list_ipv6); } ircd-hybrid-8.1.13.dfsg.1/src/resv.c0000644000175000017500000001113512263053413015117 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * resv.c: Functions to reserve(jupe) a nick/channel. * * Copyright (C) 2001-2002 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: resv.c 2173 2013-06-03 19:40:02Z michael $ */ #include "stdinc.h" #include "list.h" #include "ircd.h" #include "send.h" #include "client.h" #include "memory.h" #include "numeric.h" #include "resv.h" #include "hash.h" #include "irc_string.h" #include "ircd_defs.h" #include "s_misc.h" #include "conf.h" #include "conf_db.h" #include "channel.h" #include "hostmask.h" /* create_resv() * * inputs - name of nick to create resv for * - reason for resv * - 1 if from ircd.conf, 0 if from elsewhere * output - pointer to struct ResvNick * side effects - */ struct MaskItem * create_resv(const char *name, const char *reason, const dlink_list *list) { dlink_node *ptr = NULL; struct MaskItem *conf = NULL; enum maskitem_type type; if (name == NULL || reason == NULL) return NULL; if (IsChanPrefix(*name)) type = CONF_CRESV; else type = CONF_NRESV; if (find_exact_name_conf(type, NULL, name, NULL, NULL)) return NULL; conf = conf_make(type); conf->name = xstrdup(name); conf->reason = xstrndup(reason, IRCD_MIN(strlen(reason), REASONLEN)); if (list) { DLINK_FOREACH(ptr, list->head) { char nick[NICKLEN + 1]; char user[USERLEN + 1]; char host[HOSTLEN + 1]; struct split_nuh_item nuh; struct exempt *exptr = NULL; char *s = ptr->data; if (strlen(s) == 2 && IsAlpha(*(s + 1) && IsAlpha(*(s + 2)))) { #ifdef HAVE_LIBGEOIP exptr = MyMalloc(sizeof(*exptr)); exptr->name = xstrdup(s); exptr->coid = GeoIP_id_by_code(s); dlinkAdd(exptr, &exptr->node, &conf->exempt_list); #endif } else { nuh.nuhmask = s; nuh.nickptr = nick; nuh.userptr = user; nuh.hostptr = host; nuh.nicksize = sizeof(nick); nuh.usersize = sizeof(user); nuh.hostsize = sizeof(host); split_nuh(&nuh); exptr = MyMalloc(sizeof(*exptr)); exptr->name = xstrdup(nick); exptr->user = xstrdup(user); exptr->host = xstrdup(host); exptr->type = parse_netmask(host, &exptr->addr, &exptr->bits); dlinkAdd(exptr, &exptr->node, &conf->exempt_list); } } } return conf; } int resv_find_exempt(const struct Client *who, const struct MaskItem *conf) { const dlink_node *ptr = NULL; DLINK_FOREACH(ptr, conf->exempt_list.head) { const struct exempt *exptr = ptr->data; if (exptr->coid) { if (exptr->coid == who->localClient->country_id) return 1; } else if (!match(exptr->name, who->name) && !match(exptr->user, who->username)) { switch (exptr->type) { case HM_HOST: if (!match(exptr->host, who->host) || !match(exptr->host, who->sockhost)) return 1; break; case HM_IPV4: if (who->localClient->aftype == AF_INET) if (match_ipv4(&who->localClient->ip, &exptr->addr, exptr->bits)) return 1; break; #ifdef IPV6 case HM_IPV6: if (who->localClient->aftype == AF_INET6) if (match_ipv6(&who->localClient->ip, &exptr->addr, exptr->bits)) return 1; break; #endif default: assert(0); } } } return 0; } /* match_find_resv() * * inputs - pointer to name * output - pointer to a struct ResvChannel * side effects - Finds a reserved channel whose name matches 'name', * if can't find one returns NULL. */ struct MaskItem * match_find_resv(const char *name) { dlink_node *ptr = NULL; if (EmptyString(name)) return NULL; DLINK_FOREACH(ptr, cresv_items.head) { struct MaskItem *conf = ptr->data; if (!match(conf->name, name)) return conf; } return NULL; } ircd-hybrid-8.1.13.dfsg.1/src/whowas.c0000644000175000017500000000643112263053413015453 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * whowas.c: WHOWAS user cache. * * Copyright (C) 2005 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: whowas.c 2747 2014-01-05 19:19:06Z michael $ */ #include "stdinc.h" #include "list.h" #include "whowas.h" #include "client.h" #include "hash.h" #include "irc_string.h" #include "ircd.h" static struct Whowas WHOWAS[NICKNAMEHISTORYLENGTH]; dlink_list WHOWASHASH[HASHSIZE]; void whowas_init(void) { unsigned int idx; for (idx = 0; idx < NICKNAMEHISTORYLENGTH; ++idx) WHOWAS[idx].hashv = -1; } void whowas_add_history(struct Client *client_p, const int online) { static unsigned int whowas_next = 0; struct Whowas *who = &WHOWAS[whowas_next]; assert(client_p && client_p->servptr); if (++whowas_next == NICKNAMEHISTORYLENGTH) whowas_next = 0; if (who->hashv != -1) { if (who->online) dlinkDelete(&who->cnode, &who->online->whowas); dlinkDelete(&who->tnode, &WHOWASHASH[who->hashv]); } who->hashv = strhash(client_p->name); who->shide = IsHidden(client_p->servptr) != 0; who->logoff = CurrentTime; strlcpy(who->name, client_p->name, sizeof(who->name)); strlcpy(who->username, client_p->username, sizeof(who->username)); strlcpy(who->hostname, client_p->host, sizeof(who->hostname)); strlcpy(who->realname, client_p->info, sizeof(who->realname)); strlcpy(who->servername, client_p->servptr->name, sizeof(who->servername)); if (online) { who->online = client_p; dlinkAdd(who, &who->cnode, &client_p->whowas); } else who->online = NULL; dlinkAdd(who, &who->tnode, &WHOWASHASH[who->hashv]); } void whowas_off_history(struct Client *client_p) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, client_p->whowas.head) { struct Whowas *temp = ptr->data; temp->online = NULL; dlinkDelete(&temp->cnode, &client_p->whowas); } } struct Client * whowas_get_history(const char *nick, time_t timelimit) { dlink_node *ptr = NULL; timelimit = CurrentTime - timelimit; DLINK_FOREACH(ptr, WHOWASHASH[strhash(nick)].head) { struct Whowas *temp = ptr->data; if (temp->logoff < timelimit) continue; if (irccmp(nick, temp->name)) continue; return temp->online; } return NULL; } void whowas_count_memory(unsigned int *const count, uint64_t *const bytes) { const struct Whowas *tmp = &WHOWAS[0]; unsigned int i = 0; for (; i < NICKNAMEHISTORYLENGTH; ++i, ++tmp) { if (tmp->hashv != -1) { (*count)++; (*bytes) += sizeof(struct Whowas); } } } ircd-hybrid-8.1.13.dfsg.1/src/s_misc.c0000644000175000017500000000647012263053413015423 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_misc.c: Yet another miscellaneous functions file. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_misc.c 2302 2013-06-19 12:21:42Z michael $ */ #include "stdinc.h" #include "s_misc.h" #include "client.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "irc_res.h" #include "fdlist.h" #include "s_bsd.h" #include "conf.h" #include "s_serv.h" #include "send.h" #include "memory.h" static const char *const months[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November","December" }; static const char *const weekdays[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; const char * date(time_t lclock) { static char buf[80], plus; struct tm *lt, *gm; struct tm gmbuf; int minswest; if (!lclock) lclock = CurrentTime; gm = gmtime(&lclock); memcpy(&gmbuf, gm, sizeof(gmbuf)); gm = &gmbuf; lt = localtime(&lclock); /* * There is unfortunately no clean portable way to extract time zone * offset information, so do ugly things. */ minswest = (gm->tm_hour - lt->tm_hour) * 60 + (gm->tm_min - lt->tm_min); if (lt->tm_yday != gm->tm_yday) { if ((lt->tm_yday > gm->tm_yday && lt->tm_year == gm->tm_year) || (lt->tm_yday < gm->tm_yday && lt->tm_year != gm->tm_year)) minswest -= 24 * 60; else minswest += 24 * 60; } plus = (minswest > 0) ? '-' : '+'; if (minswest < 0) minswest = -minswest; snprintf(buf, sizeof(buf), "%s %s %d %d -- %02u:%02u:%02u %c%02u:%02u", weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday, lt->tm_year + 1900, lt->tm_hour, lt->tm_min, lt->tm_sec, plus, minswest/60, minswest%60); return buf; } const char * smalldate(time_t lclock) { static char buf[MAX_DATE_STRING]; struct tm *lt, *gm; struct tm gmbuf; if (!lclock) lclock = CurrentTime; gm = gmtime(&lclock); memcpy(&gmbuf, gm, sizeof(gmbuf)); gm = &gmbuf; lt = localtime(&lclock); snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min); return buf; } #ifdef HAVE_LIBCRYPTO const char * ssl_get_cipher(const SSL *ssl) { static char buffer[IRCD_BUFSIZE / 4]; int bits = 0; SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits); snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl), SSL_get_cipher(ssl), bits); return buffer; } #endif ircd-hybrid-8.1.13.dfsg.1/src/dbuf.c0000644000175000017500000000525712263053413015070 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * dbuf.c: Supports dynamic data buffers. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: dbuf.c 1654 2012-11-16 19:39:37Z michael $ */ #include "stdinc.h" #include "list.h" #include "dbuf.h" #include "memory.h" #include "mempool.h" static mp_pool_t *dbuf_pool; void dbuf_init(void) { dbuf_pool = mp_pool_new(sizeof(struct dbuf_block), MP_CHUNK_SIZE_DBUF); } static struct dbuf_block * dbuf_alloc(struct dbuf_queue *qptr) { struct dbuf_block *block = mp_pool_get(dbuf_pool); memset(block, 0, sizeof(*block)); dlinkAddTail(block, make_dlink_node(), &qptr->blocks); return block; } void dbuf_put(struct dbuf_queue *qptr, char *data, size_t count) { struct dbuf_block *last; size_t amount; assert(count > 0); if (qptr->blocks.tail == NULL) dbuf_alloc(qptr); do { last = qptr->blocks.tail->data; amount = DBUF_BLOCK_SIZE - last->size; if (!amount) { last = dbuf_alloc(qptr); amount = DBUF_BLOCK_SIZE; } if (amount > count) amount = count; memcpy((void *) &last->data[last->size], data, amount); count -= amount; last->size += amount; qptr->total_size += amount; data += amount; } while (count > 0); } void dbuf_delete(struct dbuf_queue *qptr, size_t count) { dlink_node *ptr; struct dbuf_block *first; assert(qptr->total_size >= count); if (count == 0) return; /* free whole blocks first.. */ while (1) { if (!count) return; ptr = qptr->blocks.head; first = ptr->data; if (count < first->size) break; qptr->total_size -= first->size; count -= first->size; dlinkDelete(ptr, &qptr->blocks); free_dlink_node(ptr); mp_pool_release(first); } /* ..then remove data from the beginning of the queue */ first->size -= count; qptr->total_size -= count; memmove((void *) &first->data, (void *) &first->data[count], first->size); } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd_kqueue.c0000644000175000017500000001211212263053413016605 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd_kqueue.c: FreeBSD kqueue compatible network routines. * * Originally by Adrian Chadd * Copyright (C) 2005 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd_kqueue.c 2724 2013-12-29 13:00:42Z michael $ */ #include "stdinc.h" #if USE_IOPOLL_MECHANISM == __IOPOLL_MECHANISM_KQUEUE #include #include "fdlist.h" #include "ircd.h" #include "memory.h" #include "s_bsd.h" #include "log.h" #define KE_LENGTH 128 /* jlemon goofed up and didn't add EV_SET until fbsd 4.3 */ #ifndef EV_SET #define EV_SET(kevp, a, b, c, d, e, f) do { \ (kevp)->ident = (a); \ (kevp)->filter = (b); \ (kevp)->flags = (c); \ (kevp)->fflags = (d); \ (kevp)->data = (e); \ (kevp)->udata = (f); \ } while(0) #endif static fde_t kqfd; static struct kevent kq_fdlist[KE_LENGTH]; /* kevent buffer */ static int kqoff; /* offset into the buffer */ /* * init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ void init_netio(void) { int fd; if ((fd = kqueue()) < 0) { ilog(LOG_TYPE_IRCD, "init_netio: Couldn't open kqueue fd!"); exit(115); /* Whee! */ } fd_open(&kqfd, fd, 0, "kqueue() file descriptor"); } /* * Write a single update to the kqueue list. */ static void kq_update_events(int fd, int filter, int what) { static struct timespec zero_timespec = {0, 0}; struct kevent *kep = kq_fdlist + kqoff; EV_SET(kep, (uintptr_t) fd, (short) filter, what, 0, 0, NULL); if (++kqoff == KE_LENGTH) { int i; for (i = 0; i < kqoff; ++i) kevent(kqfd.fd, &kq_fdlist[i], 1, NULL, 0, &zero_timespec); kqoff = 0; } } /* * comm_setselect * * This is a needed exported function which will be called to register * and deregister interest in a pending IO state for a given FD. */ void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) { int new_events, diff; if ((type & COMM_SELECT_READ)) { F->read_handler = handler; F->read_data = client_data; } if ((type & COMM_SELECT_WRITE)) { F->write_handler = handler; F->write_data = client_data; } new_events = (F->read_handler ? COMM_SELECT_READ : 0) | (F->write_handler ? COMM_SELECT_WRITE : 0); if (timeout != 0) { F->timeout = CurrentTime + (timeout / 1000); F->timeout_handler = handler; F->timeout_data = client_data; } diff = new_events ^ F->evcache; if ((diff & COMM_SELECT_READ)) kq_update_events(F->fd, EVFILT_READ, (new_events & COMM_SELECT_READ) ? EV_ADD : EV_DELETE); if ((diff & COMM_SELECT_WRITE)) kq_update_events(F->fd, EVFILT_WRITE, (new_events & COMM_SELECT_WRITE) ? EV_ADD : EV_DELETE); F->evcache = new_events; } /* * comm_select * * Called to do the new-style IO, courtesy of squid (like most of this * new IO code). This routine handles the stuff we've hidden in * comm_setselect and fd_table[] and calls callbacks for IO ready * events. */ void comm_select(void) { int num, i; static struct kevent ke[KE_LENGTH]; struct timespec poll_time; PF *hdl; fde_t *F; /* * remember we are doing NANOseconds here, not micro/milli. God knows * why jlemon used a timespec, but hey, he wrote the interface, not I * -- Adrian */ poll_time.tv_sec = 0; poll_time.tv_nsec = SELECT_DELAY * 1000000; num = kevent(kqfd.fd, kq_fdlist, kqoff, ke, KE_LENGTH, &poll_time); kqoff = 0; set_time(); if (num < 0) { #ifdef HAVE_USLEEP usleep(50000); /* avoid 99% CPU in comm_select */ #endif return; } for (i = 0; i < num; i++) { F = lookup_fd(ke[i].ident); if (F == NULL || !F->flags.open || (ke[i].flags & EV_ERROR)) continue; if (ke[i].filter == EVFILT_READ) { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); if (!F->flags.open) continue; } } if (ke[i].filter == EVFILT_WRITE) { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); if (!F->flags.open) continue; } } comm_setselect(F, 0, NULL, NULL, 0); } } #endif ircd-hybrid-8.1.13.dfsg.1/src/getopt.c0000644000175000017500000000653612263053413015453 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * getopt.c: Uses getopt to fetch the command line options. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: getopt.c 1357 2012-04-21 20:47:01Z michael $ */ #include "stdinc.h" #include "ircd_getopt.h" #define OPTCHAR '-' static void usage(const char *name, const struct lgetopt *opts) { unsigned int i; fprintf(stderr, "Usage: %s [options]\n", name); fprintf(stderr, "Where valid options are:\n"); for (i = 0; opts[i].opt; ++i) fprintf(stderr, "\t%c%-10s %-20s%s\n", OPTCHAR, opts[i].opt, (opts[i].argtype == YESNO || opts[i].argtype == USAGE) ? "" : opts[i].argtype == INTEGER ? "" : "", opts[i].desc); exit(EXIT_FAILURE); } void parseargs(int *argc, char ***argv, struct lgetopt *opts) { unsigned int i; const char *progname = (*argv)[0]; /* loop through each argument */ while (1) { int found = 0; (*argc)--; (*argv)++; if (*argc < 1 || (*argv)[0][0] != OPTCHAR) return; (*argv)[0]++; /* search through our argument list, and see if it matches */ for (i = 0; opts[i].opt; i++) { if (!strcmp(opts[i].opt, (*argv)[0])) { /* found our argument */ found = 1; switch (opts[i].argtype) { case YESNO: *((int *)opts[i].argloc) = 1; break; case INTEGER: if (*argc < 2) { fprintf(stderr, "Error: option '%c%s' requires an argument\n", OPTCHAR, opts[i].opt); usage((*argv)[0], opts); } *((int *)opts[i].argloc) = atoi((*argv)[1]); (*argc)--; (*argv)++; break; case STRING: if (*argc < 2) { fprintf(stderr, "error: option '%c%s' requires an argument\n", OPTCHAR, opts[i].opt); usage(progname, opts); } *((char**)opts[i].argloc) = malloc(strlen((*argv)[1]) + 1); strcpy(*((char**)opts[i].argloc), (*argv)[1]); (*argc)--; (*argv)++; break; case USAGE: usage(progname, opts); /* NOTREACHED */ default: fprintf(stderr, "Error: internal error in parseargs() at %s:%d\n", __FILE__, __LINE__); exit(EXIT_FAILURE); } } } if (!found) { fprintf(stderr, "error: unknown argument '%c%s'\n", OPTCHAR, (*argv)[0]); usage(progname, opts); } } } ircd-hybrid-8.1.13.dfsg.1/src/s_bsd_poll.c0000644000175000017500000001125212263053413016260 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * s_bsd_poll.c: POSIX poll() compatible network routines. * * Originally by Adrian Chadd * Copyright (C) 2002 Hybrid Development Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: s_bsd_poll.c 2724 2013-12-29 13:00:42Z michael $ */ #include "stdinc.h" #if USE_IOPOLL_MECHANISM == __IOPOLL_MECHANISM_POLL #include #include "fdlist.h" #include "list.h" #include "memory.h" #include "hook.h" #include "ircd.h" #include "s_bsd.h" #include "log.h" /* I hate linux -- adrian */ #ifndef POLLRDNORM #define POLLRDNORM POLLIN #endif #ifndef POLLWRNORM #define POLLWRNORM POLLOUT #endif static struct pollfd *pollfds; static int pollmax = -1; /* highest FD number */ /* * init_netio * * This is a needed exported function which will be called to initialise * the network loop code. */ void init_netio(void) { int fd; pollfds = MyMalloc(sizeof(struct pollfd) * hard_fdlimit); for (fd = 0; fd < hard_fdlimit; fd++) pollfds[fd].fd = -1; } /* * find a spare slot in the fd list. We can optimise this out later! * -- adrian */ static inline int poll_findslot(void) { int i; for (i = 0; i < hard_fdlimit; i++) if (pollfds[i].fd == -1) { /* MATCH!!#$*&$ */ return i; } assert(1 == 0); /* NOTREACHED */ return -1; } /* * comm_setselect * * This is a needed exported function which will be called to register * and deregister interest in a pending IO state for a given FD. */ void comm_setselect(fde_t *F, unsigned int type, PF *handler, void *client_data, time_t timeout) { int new_events; if ((type & COMM_SELECT_READ)) { F->read_handler = handler; F->read_data = client_data; } if ((type & COMM_SELECT_WRITE)) { F->write_handler = handler; F->write_data = client_data; } new_events = (F->read_handler ? POLLRDNORM : 0) | (F->write_handler ? POLLWRNORM : 0); if (timeout != 0) { F->timeout = CurrentTime + (timeout / 1000); F->timeout_handler = handler; F->timeout_data = client_data; } if (new_events != F->evcache) { if (new_events == 0) { pollfds[F->comm_index].fd = -1; pollfds[F->comm_index].revents = 0; if (pollmax == F->comm_index) while (pollmax >= 0 && pollfds[pollmax].fd == -1) pollmax--; } else { if (F->evcache == 0) { F->comm_index = poll_findslot(); if (F->comm_index > pollmax) pollmax = F->comm_index; pollfds[F->comm_index].fd = F->fd; } pollfds[F->comm_index].events = new_events; pollfds[F->comm_index].revents = 0; } F->evcache = new_events; } } /* * comm_select * * Called to do the new-style IO, courtesy of of squid (like most of this * new IO code). This routine handles the stuff we've hidden in * comm_setselect and fd_table[] and calls callbacks for IO ready * events. */ void comm_select(void) { int num, ci, revents; PF *hdl; fde_t *F; /* XXX kill that +1 later ! -- adrian */ num = poll(pollfds, pollmax + 1, SELECT_DELAY); set_time(); if (num < 0) { #ifdef HAVE_USLEEP usleep(50000); /* avoid 99% CPU in comm_select */ #endif return; } for (ci = 0; ci <= pollmax && num > 0; ci++) { if ((revents = pollfds[ci].revents) == 0 || pollfds[ci].fd == -1) continue; num--; F = lookup_fd(pollfds[ci].fd); if (F == NULL || !F->flags.open) continue; if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); if (!F->flags.open) continue; } } if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); if (!F->flags.open) continue; } } comm_setselect(F, 0, NULL, NULL, 0); } } #endif ircd-hybrid-8.1.13.dfsg.1/src/list.c0000644000175000017500000001350712263053413015120 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * list.c: Various assorted functions for various structures. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: list.c 2715 2013-12-24 21:15:36Z michael $ */ #include "stdinc.h" #include "list.h" #include "mempool.h" static mp_pool_t *dnode_pool; /* init_dlink_nodes() * * inputs - NONE * output - NONE * side effects - initializes the dnode BlockHeap */ void init_dlink_nodes(void) { dnode_pool = mp_pool_new(sizeof(dlink_node), MP_CHUNK_SIZE_DNODE); } /* make_dlink_node() * * inputs - NONE * output - pointer to new dlink_node * side effects - NONE */ dlink_node * make_dlink_node(void) { dlink_node *ptr = mp_pool_get(dnode_pool); memset(ptr, 0, sizeof(*ptr)); return ptr; } /* free_dlink_node() * * inputs - pointer to dlink_node * output - NONE * side effects - free given dlink_node */ void free_dlink_node(dlink_node *ptr) { mp_pool_release(ptr); } /* * dlink_ routines are stolen from squid, except for dlinkAddBefore, * which is mine. * -- adrian */ void dlinkAdd(void *data, dlink_node *m, dlink_list *list) { m->data = data; m->prev = NULL; m->next = list->head; /* Assumption: If list->tail != NULL, list->head != NULL */ if (list->head != NULL) list->head->prev = m; else if (list->tail == NULL) list->tail = m; list->head = m; list->length++; } void dlinkAddBefore(dlink_node *b, void *data, dlink_node *m, dlink_list *list) { /* Shortcut - if its the first one, call dlinkAdd only */ if (b == list->head) dlinkAdd(data, m, list); else { m->data = data; b->prev->next = m; m->prev = b->prev; b->prev = m; m->next = b; list->length++; } } void dlinkAddTail(void *data, dlink_node *m, dlink_list *list) { m->data = data; m->next = NULL; m->prev = list->tail; /* Assumption: If list->tail != NULL, list->head != NULL */ if (list->tail != NULL) list->tail->next = m; else if (list->head == NULL) list->head = m; list->tail = m; list->length++; } /* Execution profiles show that this function is called the most * often of all non-spontaneous functions. So it had better be * efficient. */ void dlinkDelete(dlink_node *m, dlink_list *list) { /* Assumption: If m->next == NULL, then list->tail == m * and: If m->prev == NULL, then list->head == m */ if (m->next) m->next->prev = m->prev; else { assert(list->tail == m); list->tail = m->prev; } if (m->prev) m->prev->next = m->next; else { assert(list->head == m); list->head = m->next; } /* Set this to NULL does matter */ m->next = m->prev = NULL; list->length--; } /* * dlinkFind * inputs - list to search * - data * output - pointer to link or NULL if not found * side effects - Look for ptr in the linked listed pointed to by link. */ dlink_node * dlinkFind(dlink_list *list, void *data) { dlink_node *ptr; DLINK_FOREACH(ptr, list->head) if (ptr->data == data) return ptr; return NULL; } void dlinkMoveList(dlink_list *from, dlink_list *to) { /* There are three cases */ /* case one, nothing in from list */ if (from->head == NULL) return; /* case two, nothing in to list */ /* actually if to->head is NULL and to->tail isn't, thats a bug */ if (to->head == NULL) { to->head = from->head; to->tail = from->tail; from->head = from->tail = NULL; to->length = from->length; from->length = 0; return; } /* third case play with the links */ from->tail->next = to->head; from->head->prev = to->head->prev; to->head->prev = from->tail; to->head = from->head; from->head = from->tail = NULL; to->length += from->length; from->length = 0; /* I think I got that right */ } void dlink_move_node(dlink_node *m, dlink_list *list_del, dlink_list *list_add) { /* Assumption: If m->next == NULL, then list_del->tail == m * and: If m->prev == NULL, then list_del->head == m */ if (m->next) m->next->prev = m->prev; else { assert(list_del->tail == m); list_del->tail = m->prev; } if (m->prev) m->prev->next = m->next; else { assert(list_del->head == m); list_del->head = m->next; } /* Set this to NULL does matter */ m->prev = NULL; m->next = list_add->head; /* Assumption: If list_add->tail != NULL, list_add->head != NULL */ if (list_add->head != NULL) list_add->head->prev = m; else if (list_add->tail == NULL) list_add->tail = m; list_add->head = m; list_add->length++; list_del->length--; } dlink_node * dlinkFindDelete(dlink_list *list, void *data) { dlink_node *m = NULL; DLINK_FOREACH(m, list->head) { if (m->data != data) continue; if (m->next) m->next->prev = m->prev; else { assert(list->tail == m); list->tail = m->prev; } if (m->prev) m->prev->next = m->next; else { assert(list->head == m); list->head = m->next; } /* Set this to NULL does matter */ m->next = m->prev = NULL; list->length--; return m; } return NULL; } ircd-hybrid-8.1.13.dfsg.1/src/hash.c0000644000175000017500000004751212263053413015073 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * hash.c: Maintains hashtables. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: hash.c 2758 2014-01-05 23:20:30Z michael $ */ #include "stdinc.h" #include "list.h" #include "conf.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "modules.h" #include "hash.h" #include "resv.h" #include "rng_mt.h" #include "userhost.h" #include "irc_string.h" #include "ircd.h" #include "numeric.h" #include "send.h" #include "memory.h" #include "mempool.h" #include "dbuf.h" #include "s_user.h" static mp_pool_t *userhost_pool = NULL; static mp_pool_t *namehost_pool = NULL; static unsigned int hashf_xor_key = 0; /* The actual hash tables, They MUST be of the same HASHSIZE, variable * size tables could be supported but the rehash routine should also * rebuild the transformation maps, I kept the tables of equal size * so that I can use one hash function. */ static struct Client *idTable[HASHSIZE]; static struct Client *clientTable[HASHSIZE]; static struct Channel *channelTable[HASHSIZE]; static struct UserHost *userhostTable[HASHSIZE]; /* init_hash() * * inputs - NONE * output - NONE * side effects - Initialize the maps used by hash * functions and clear the tables */ void hash_init(void) { userhost_pool = mp_pool_new(sizeof(struct UserHost), MP_CHUNK_SIZE_USERHOST); namehost_pool = mp_pool_new(sizeof(struct NameHost), MP_CHUNK_SIZE_NAMEHOST); hashf_xor_key = genrand_int32() % 256; /* better than nothing --adx */ } /* * New hash function based on the Fowler/Noll/Vo (FNV) algorithm from * http://www.isthe.com/chongo/tech/comp/fnv/ * * Here, we use the FNV-1 method, which gives slightly better results * than FNV-1a. -Michael */ unsigned int strhash(const char *name) { const unsigned char *p = (const unsigned char *)name; unsigned int hval = FNV1_32_INIT; if (EmptyString(p)) return 0; for (; *p != '\0'; ++p) { hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); hval ^= (ToLower(*p) ^ hashf_xor_key); } return (hval >> FNV1_32_BITS) ^ (hval & ((1 << FNV1_32_BITS) - 1)); } /************************** Externally visible functions ********************/ /* Optimization note: in these functions I supposed that the CSE optimization * (Common Subexpression Elimination) does its work decently, this means that * I avoided introducing new variables to do the work myself and I did let * the optimizer play with more free registers, actual tests proved this * solution to be faster than doing things like tmp2=tmp->hnext... and then * use tmp2 myself which would have given less freedom to the optimizer. */ /* hash_add_client() * * inputs - pointer to client * output - NONE * side effects - Adds a client's name in the proper hash linked * list, can't fail, client_p must have a non-null * name or expect a coredump, the name is infact * taken from client_p->name */ void hash_add_client(struct Client *client_p) { unsigned int hashv = strhash(client_p->name); client_p->hnext = clientTable[hashv]; clientTable[hashv] = client_p; } /* hash_add_channel() * * inputs - pointer to channel * output - NONE * side effects - Adds a channel's name in the proper hash linked * list, can't fail. chptr must have a non-null name * or expect a coredump. As before the name is taken * from chptr->name, we do hash its entire lenght * since this proved to be statistically faster */ void hash_add_channel(struct Channel *chptr) { unsigned int hashv = strhash(chptr->chname); chptr->hnextch = channelTable[hashv]; channelTable[hashv] = chptr; } void hash_add_userhost(struct UserHost *userhost) { unsigned int hashv = strhash(userhost->host); userhost->next = userhostTable[hashv]; userhostTable[hashv] = userhost; } void hash_add_id(struct Client *client_p) { unsigned int hashv = strhash(client_p->id); client_p->idhnext = idTable[hashv]; idTable[hashv] = client_p; } /* hash_del_id() * * inputs - pointer to client * output - NONE * side effects - Removes an ID from the hash linked list */ void hash_del_id(struct Client *client_p) { unsigned int hashv = strhash(client_p->id); struct Client *tmp = idTable[hashv]; if (tmp != NULL) { if (tmp == client_p) { idTable[hashv] = client_p->idhnext; client_p->idhnext = client_p; } else { while (tmp->idhnext != client_p) if ((tmp = tmp->idhnext) == NULL) return; tmp->idhnext = tmp->idhnext->idhnext; client_p->idhnext = client_p; } } } /* hash_del_client() * * inputs - pointer to client * output - NONE * side effects - Removes a Client's name from the hash linked list */ void hash_del_client(struct Client *client_p) { unsigned int hashv = strhash(client_p->name); struct Client *tmp = clientTable[hashv]; if (tmp != NULL) { if (tmp == client_p) { clientTable[hashv] = client_p->hnext; client_p->hnext = client_p; } else { while (tmp->hnext != client_p) if ((tmp = tmp->hnext) == NULL) return; tmp->hnext = tmp->hnext->hnext; client_p->hnext = client_p; } } } /* hash_del_userhost() * * inputs - pointer to userhost * output - NONE * side effects - Removes a userhost from the hash linked list */ void hash_del_userhost(struct UserHost *userhost) { unsigned int hashv = strhash(userhost->host); struct UserHost *tmp = userhostTable[hashv]; if (tmp != NULL) { if (tmp == userhost) { userhostTable[hashv] = userhost->next; userhost->next = userhost; } else { while (tmp->next != userhost) if ((tmp = tmp->next) == NULL) return; tmp->next = tmp->next->next; userhost->next = userhost; } } } /* hash_del_channel() * * inputs - pointer to client * output - NONE * side effects - Removes the channel's name from the corresponding * hash linked list */ void hash_del_channel(struct Channel *chptr) { unsigned int hashv = strhash(chptr->chname); struct Channel *tmp = channelTable[hashv]; if (tmp != NULL) { if (tmp == chptr) { channelTable[hashv] = chptr->hnextch; chptr->hnextch = chptr; } else { while (tmp->hnextch != chptr) if ((tmp = tmp->hnextch) == NULL) return; tmp->hnextch = tmp->hnextch->hnextch; chptr->hnextch = chptr; } } } /* hash_find_client() * * inputs - pointer to name * output - NONE * side effects - New semantics: finds a client whose name is 'name' * if can't find one returns NULL. If it finds one moves * it to the top of the list and returns it. */ struct Client * hash_find_client(const char *name) { unsigned int hashv = strhash(name); struct Client *client_p; if ((client_p = clientTable[hashv]) != NULL) { if (irccmp(name, client_p->name)) { struct Client *prev; while (prev = client_p, (client_p = client_p->hnext) != NULL) { if (!irccmp(name, client_p->name)) { prev->hnext = client_p->hnext; client_p->hnext = clientTable[hashv]; clientTable[hashv] = client_p; break; } } } } return client_p; } struct Client * hash_find_id(const char *name) { unsigned int hashv = strhash(name); struct Client *client_p; if ((client_p = idTable[hashv]) != NULL) { if (strcmp(name, client_p->id)) { struct Client *prev; while (prev = client_p, (client_p = client_p->idhnext) != NULL) { if (!strcmp(name, client_p->id)) { prev->idhnext = client_p->idhnext; client_p->idhnext = idTable[hashv]; idTable[hashv] = client_p; break; } } } } return client_p; } struct Client * hash_find_server(const char *name) { unsigned int hashv = strhash(name); struct Client *client_p = NULL; if (IsDigit(*name) && strlen(name) == IRC_MAXSID) return hash_find_id(name); if ((client_p = clientTable[hashv]) != NULL) { if ((!IsServer(client_p) && !IsMe(client_p)) || irccmp(name, client_p->name)) { struct Client *prev; while (prev = client_p, (client_p = client_p->hnext) != NULL) { if ((IsServer(client_p) || IsMe(client_p)) && !irccmp(name, client_p->name)) { prev->hnext = client_p->hnext; client_p->hnext = clientTable[hashv]; clientTable[hashv] = client_p; break; } } } } return client_p; } /* hash_find_channel() * * inputs - pointer to name * output - NONE * side effects - New semantics: finds a channel whose name is 'name', * if can't find one returns NULL, if can find it moves * it to the top of the list and returns it. */ struct Channel * hash_find_channel(const char *name) { unsigned int hashv = strhash(name); struct Channel *chptr = NULL; if ((chptr = channelTable[hashv]) != NULL) { if (irccmp(name, chptr->chname)) { struct Channel *prev; while (prev = chptr, (chptr = chptr->hnextch) != NULL) { if (!irccmp(name, chptr->chname)) { prev->hnextch = chptr->hnextch; chptr->hnextch = channelTable[hashv]; channelTable[hashv] = chptr; break; } } } } return chptr; } /* hash_get_bucket(int type, unsigned int hashv) * * inputs - hash value (must be between 0 and HASHSIZE - 1) * output - NONE * returns - pointer to first channel in channelTable[hashv] * if that exists; * NULL if there is no channel in that place; * NULL if hashv is an invalid number. * side effects - NONE */ void * hash_get_bucket(int type, unsigned int hashv) { assert(hashv < HASHSIZE); if (hashv >= HASHSIZE) return NULL; switch (type) { case HASH_TYPE_ID: return idTable[hashv]; break; case HASH_TYPE_CHANNEL: return channelTable[hashv]; break; case HASH_TYPE_CLIENT: return clientTable[hashv]; break; case HASH_TYPE_USERHOST: return userhostTable[hashv]; break; default: assert(0); } return NULL; } struct UserHost * hash_find_userhost(const char *host) { unsigned int hashv = strhash(host); struct UserHost *userhost; if ((userhost = userhostTable[hashv])) { if (irccmp(host, userhost->host)) { struct UserHost *prev; while (prev = userhost, (userhost = userhost->next) != NULL) { if (!irccmp(host, userhost->host)) { prev->next = userhost->next; userhost->next = userhostTable[hashv]; userhostTable[hashv] = userhost; break; } } } } return userhost; } /* count_user_host() * * inputs - user name * - hostname * - int flag 1 if global, 0 if local * - pointer to where global count should go * - pointer to where local count should go * - pointer to where identd count should go (local clients only) * output - none * side effects - */ void count_user_host(const char *user, const char *host, unsigned int *global_p, unsigned int *local_p, unsigned int *icount_p) { dlink_node *ptr; struct UserHost *found_userhost; struct NameHost *nameh; if ((found_userhost = hash_find_userhost(host)) == NULL) return; DLINK_FOREACH(ptr, found_userhost->list.head) { nameh = ptr->data; if (!irccmp(user, nameh->name)) { if (global_p != NULL) *global_p = nameh->gcount; if (local_p != NULL) *local_p = nameh->lcount; if (icount_p != NULL) *icount_p = nameh->icount; return; } } } /* find_or_add_userhost() * * inputs - host name * output - none * side effects - find UserHost * for given host name */ static struct UserHost * find_or_add_userhost(const char *host) { struct UserHost *userhost; if ((userhost = hash_find_userhost(host)) != NULL) return userhost; userhost = mp_pool_get(userhost_pool); memset(userhost, 0, sizeof(*userhost)); strlcpy(userhost->host, host, sizeof(userhost->host)); hash_add_userhost(userhost); return userhost; } /* add_user_host() * * inputs - user name * - hostname * - int flag 1 if global, 0 if local * output - none * side effects - add given user@host to hash tables */ void add_user_host(const char *user, const char *host, int global) { dlink_node *ptr; struct UserHost *found_userhost; struct NameHost *nameh; int hasident = 1; if (*user == '~') { hasident = 0; ++user; } if ((found_userhost = find_or_add_userhost(host)) == NULL) return; DLINK_FOREACH(ptr, found_userhost->list.head) { nameh = ptr->data; if (!irccmp(user, nameh->name)) { nameh->gcount++; if (!global) { if (hasident) nameh->icount++; nameh->lcount++; } return; } } nameh = mp_pool_get(namehost_pool); memset(nameh, 0, sizeof(*nameh)); strlcpy(nameh->name, user, sizeof(nameh->name)); nameh->gcount = 1; if (!global) { if (hasident) nameh->icount = 1; nameh->lcount = 1; } dlinkAdd(nameh, &nameh->node, &found_userhost->list); } /* delete_user_host() * * inputs - user name * - hostname * - int flag 1 if global, 0 if local * output - none * side effects - delete given user@host to hash tables */ void delete_user_host(const char *user, const char *host, int global) { dlink_node *ptr = NULL, *next_ptr = NULL; struct UserHost *found_userhost; struct NameHost *nameh; int hasident = 1; if (*user == '~') { hasident = 0; ++user; } if ((found_userhost = hash_find_userhost(host)) == NULL) return; DLINK_FOREACH_SAFE(ptr, next_ptr, found_userhost->list.head) { nameh = ptr->data; if (!irccmp(user, nameh->name)) { if (nameh->gcount > 0) nameh->gcount--; if (!global) { if (nameh->lcount > 0) nameh->lcount--; if (hasident && nameh->icount > 0) nameh->icount--; } if (nameh->gcount == 0 && nameh->lcount == 0) { dlinkDelete(&nameh->node, &found_userhost->list); mp_pool_release(nameh); } if (dlink_list_length(&found_userhost->list) == 0) { hash_del_userhost(found_userhost); mp_pool_release(found_userhost); } return; } } } /* * Safe list code. * * The idea is really quite simple. As the link lists pointed to in * each "bucket" of the channel hash table are traversed atomically * there is no locking needed. Overall, yes, inconsistent reported * state can still happen, but normally this isn't a big deal. * I don't like sticking the code into hash.c but oh well. Moreover, * if a hash isn't used in future, oops. * * - Dianora */ /* exceeding_sendq() * * inputs - pointer to client to check * output - 1 if client is in danger of blowing its sendq * 0 if it is not. * side effects - * * Sendq limit is fairly conservative at 1/2 (In original anyway) */ static int exceeding_sendq(const struct Client *to) { if (dbuf_length(&to->localClient->buf_sendq) > (get_sendq(&to->localClient->confs) / 2)) return 1; else return 0; } void free_list_task(struct ListTask *lt, struct Client *source_p) { dlink_node *dl = NULL, *dln = NULL; if ((dl = dlinkFindDelete(&listing_client_list, source_p)) != NULL) free_dlink_node(dl); DLINK_FOREACH_SAFE(dl, dln, lt->show_mask.head) { MyFree(dl->data); free_dlink_node(dl); } DLINK_FOREACH_SAFE(dl, dln, lt->hide_mask.head) { MyFree(dl->data); free_dlink_node(dl); } MyFree(lt); if (MyConnect(source_p)) source_p->localClient->list_task = NULL; } /* list_allow_channel() * * inputs - channel name * - pointer to a list task * output - 1 if the channel is to be displayed * 0 otherwise * side effects - */ static int list_allow_channel(const char *chname, const struct ListTask *lt) { const dlink_node *dl = NULL; DLINK_FOREACH(dl, lt->show_mask.head) if (match(dl->data, chname) != 0) return 0; DLINK_FOREACH(dl, lt->hide_mask.head) if (match(dl->data, chname) == 0) return 0; return 1; } /* list_one_channel() * * inputs - client pointer to return result to * - pointer to channel to list * - pointer to ListTask structure * output - none * side effects - */ static void list_one_channel(struct Client *source_p, struct Channel *chptr, struct ListTask *list_task) { char listbuf[MODEBUFLEN] = ""; char modebuf[MODEBUFLEN] = ""; char parabuf[MODEBUFLEN] = ""; if (SecretChannel(chptr) && !(IsMember(source_p, chptr) || HasUMode(source_p, UMODE_ADMIN))) return; if (dlink_list_length(&chptr->members) < list_task->users_min || dlink_list_length(&chptr->members) > list_task->users_max || (chptr->channelts != 0 && ((unsigned int)chptr->channelts < list_task->created_min || (unsigned int)chptr->channelts > list_task->created_max)) || (unsigned int)chptr->topic_time < list_task->topicts_min || (chptr->topic_time ? (unsigned int)chptr->topic_time : UINT_MAX) > list_task->topicts_max) return; if (!list_allow_channel(chptr->chname, list_task)) return; if (HasUMode(source_p, UMODE_ADMIN)) { channel_modes(chptr, source_p, modebuf, parabuf); if (chptr->topic[0]) snprintf(listbuf, sizeof(listbuf), "[%s] ", modebuf); else snprintf(listbuf, sizeof(listbuf), "[%s]", modebuf); } sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name, chptr->chname, dlink_list_length(&chptr->members), listbuf, chptr->topic); } /* safe_list_channels() * * inputs - pointer to client requesting list * output - 0/1 * side effects - safely list all channels to source_p * * Walk the channel buckets, ensure all pointers in a bucket are * traversed before blocking on a sendq. This means, no locking is needed. * * N.B. This code is "remote" safe, but is not currently used for * remote clients. * * - Dianora */ void safe_list_channels(struct Client *source_p, struct ListTask *list_task, int only_unmasked_channels) { struct Channel *chptr = NULL; if (!only_unmasked_channels) { unsigned int i; for (i = list_task->hash_index; i < HASHSIZE; ++i) { if (exceeding_sendq(source_p->from)) { list_task->hash_index = i; return; /* still more to do */ } for (chptr = channelTable[i]; chptr; chptr = chptr->hnextch) list_one_channel(source_p, chptr, list_task); } } else { dlink_node *dl; DLINK_FOREACH(dl, list_task->show_mask.head) if ((chptr = hash_find_channel(dl->data)) != NULL) list_one_channel(source_p, chptr, list_task); } free_list_task(list_task, source_p); sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name); } ircd-hybrid-8.1.13.dfsg.1/src/ircd.c0000644000175000017500000004210012263053413015055 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * ircd.c: Starts up and runs the ircd. * * Copyright (C) 2002 by the past and present ircd coders, and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * $Id: ircd.c 2690 2013-12-17 18:55:43Z michael $ */ #include "stdinc.h" #include "s_user.h" #include "list.h" #include "ircd.h" #include "channel.h" #include "channel_mode.h" #include "client.h" #include "event.h" #include "fdlist.h" #include "hash.h" #include "irc_string.h" #include "ircd_signal.h" #include "s_gline.h" #include "motd.h" #include "conf.h" #include "hostmask.h" #include "numeric.h" #include "packet.h" #include "parse.h" #include "irc_res.h" #include "restart.h" #include "rng_mt.h" #include "s_auth.h" #include "s_bsd.h" #include "log.h" #include "s_misc.h" #include "s_serv.h" /* try_connections */ #include "send.h" #include "whowas.h" #include "modules.h" #include "memory.h" #include "mempool.h" #include "hook.h" #include "ircd_getopt.h" #include "supported.h" #include "watch.h" #include "conf_db.h" #include "conf_class.h" #ifdef HAVE_LIBGEOIP GeoIP *geoip_ctx; #endif /* /quote set variables */ struct SetOptions GlobalSetOptions; /* configuration set from ircd.conf */ struct config_file_entry ConfigFileEntry; /* server info set from ircd.conf */ struct server_info ServerInfo; /* admin info set from ircd.conf */ struct admin_info AdminInfo = { NULL, NULL, NULL }; struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct ServerState_t server_state = { 0 }; struct logging_entry ConfigLoggingEntry = { .use_logging = 1 }; struct ServerStatistics ServerStats; struct timeval SystemTime; struct Client me; /* That's me */ struct LocalUser meLocalUser; /* That's also part of me */ const char *logFileName = LPATH; const char *pidFileName = PPATH; char **myargv; int dorehash = 0; int doremotd = 0; /* Set to zero because it should be initialized later using * initialize_server_capabs */ int default_server_capabs = 0; unsigned int splitmode; unsigned int splitchecking; unsigned int split_users; unsigned int split_servers; /* Do klines the same way hybrid-6 did them, i.e. at the * top of the next io_loop instead of in the same loop as * the klines are being applied. * * This should fix strange CPU starvation as very indirectly reported. * (Why do you people not email bug reports? WHY? WHY?) * * - Dianora */ int rehashed_klines = 0; /* * print_startup - print startup information */ static void print_startup(int pid) { printf("ircd: version %s(%s)\n", ircd_version, serno); printf("ircd: pid %d\n", pid); printf("ircd: running in %s mode from %s\n", !server_state.foreground ? "background" : "foreground", ConfigFileEntry.dpath); } static void make_daemon(void) { int pid; if ((pid = fork()) < 0) { perror("fork"); exit(EXIT_FAILURE); } else if (pid > 0) { print_startup(pid); exit(EXIT_SUCCESS); } setsid(); } static int printVersion = 0; static struct lgetopt myopts[] = { {"configfile", &ConfigFileEntry.configfile, STRING, "File to use for ircd.conf"}, {"glinefile", &ConfigFileEntry.glinefile, STRING, "File to use for gline database"}, {"klinefile", &ConfigFileEntry.klinefile, STRING, "File to use for kline database"}, {"dlinefile", &ConfigFileEntry.dlinefile, STRING, "File to use for dline database"}, {"xlinefile", &ConfigFileEntry.xlinefile, STRING, "File to use for xline database"}, {"resvfile", &ConfigFileEntry.resvfile, STRING, "File to use for resv database"}, {"logfile", &logFileName, STRING, "File to use for ircd.log"}, {"pidfile", &pidFileName, STRING, "File to use for process ID"}, {"foreground", &server_state.foreground, YESNO, "Run in foreground (don't detach)"}, {"version", &printVersion, YESNO, "Print version and exit"}, {"help", NULL, USAGE, "Print this text"}, {NULL, NULL, STRING, NULL}, }; void set_time(void) { static char to_send[IRCD_BUFSIZE]; struct timeval newtime; newtime.tv_sec = 0; newtime.tv_usec = 0; if (gettimeofday(&newtime, NULL) == -1) { ilog(LOG_TYPE_IRCD, "Clock Failure (%s), TS can be corrupted", strerror(errno)); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Clock Failure (%s), TS can be corrupted", strerror(errno)); restart("Clock Failure"); } if (newtime.tv_sec < CurrentTime) { snprintf(to_send, sizeof(to_send), "System clock is running backwards - (%lu < %lu)", (unsigned long)newtime.tv_sec, (unsigned long)CurrentTime); report_error(L_ALL, to_send, me.name, 0); set_back_events(CurrentTime - newtime.tv_sec); } SystemTime.tv_sec = newtime.tv_sec; SystemTime.tv_usec = newtime.tv_usec; } static void io_loop(void) { while (1 == 1) { /* * Maybe we want a flags word? * ie. if (REHASHED_KLINES(global_flags)) * SET_REHASHED_KLINES(global_flags) * CLEAR_REHASHED_KLINES(global_flags) * * - Dianora */ if (rehashed_klines) { check_conf_klines(); rehashed_klines = 0; } if (listing_client_list.head) { dlink_node *ptr = NULL, *ptr_next = NULL; DLINK_FOREACH_SAFE(ptr, ptr_next, listing_client_list.head) { struct Client *client_p = ptr->data; assert(client_p->localClient->list_task); safe_list_channels(client_p, client_p->localClient->list_task, 0); } } /* Run pending events, then get the number of seconds to the next * event */ while (eventNextTime() <= CurrentTime) eventRun(); comm_select(); exit_aborted_clients(); free_exited_clients(); send_queued_all(); /* Check to see whether we have to rehash the configuration .. */ if (dorehash) { rehash(1); dorehash = 0; } if (doremotd) { motd_recache(); sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "Got signal SIGUSR1, reloading motd files"); doremotd = 0; } } } /* initalialize_global_set_options() * * inputs - none * output - none * side effects - This sets all global set options needed */ static void initialize_global_set_options(void) { memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions)); GlobalSetOptions.autoconn = 1; GlobalSetOptions.spam_time = MIN_JOIN_LEAVE_TIME; GlobalSetOptions.spam_num = MAX_JOIN_LEAVE_COUNT; if (ConfigFileEntry.default_floodcount) GlobalSetOptions.floodcount = ConfigFileEntry.default_floodcount; else GlobalSetOptions.floodcount = 10; /* XXX I have no idea what to try here - Dianora */ GlobalSetOptions.joinfloodcount = 16; GlobalSetOptions.joinfloodtime = 8; split_servers = ConfigChannel.default_split_server_count; split_users = ConfigChannel.default_split_user_count; if (split_users && split_servers && (ConfigChannel.no_create_on_split || ConfigChannel.no_join_on_split)) { splitmode = 1; splitchecking = 1; } GlobalSetOptions.ident_timeout = IDENT_TIMEOUT; /* End of global set options */ } /* initialize_server_capabs() * * inputs - none * output - none */ static void initialize_server_capabs(void) { add_capability("QS", CAP_QS, 1); add_capability("EOB", CAP_EOB, 1); add_capability("TS6", CAP_TS6, 0); add_capability("CLUSTER", CAP_CLUSTER, 1); // add_capability("FAKEHOST", CAP_FAKEHOST, 1); add_capability("SVS", CAP_SVS, 1); #ifdef HALFOPS add_capability("HOPS", CAP_HOPS, 1); #endif } /* write_pidfile() * * inputs - filename+path of pid file * output - NONE * side effects - write the pid of the ircd to filename */ static void write_pidfile(const char *filename) { FILE *fb; if ((fb = fopen(filename, "w"))) { char buff[IRCD_BUFSIZE]; unsigned int pid = (unsigned int)getpid(); snprintf(buff, sizeof(buff), "%u\n", pid); if ((fputs(buff, fb) == -1)) ilog(LOG_TYPE_IRCD, "Error writing %u to pid file %s (%s)", pid, filename, strerror(errno)); fclose(fb); } else { ilog(LOG_TYPE_IRCD, "Error opening pid file %s", filename); } } /* check_pidfile() * * inputs - filename+path of pid file * output - none * side effects - reads pid from pidfile and checks if ircd is in process * list. if it is, gracefully exits * -kre */ static void check_pidfile(const char *filename) { FILE *fb; char buff[IRCD_BUFSIZE]; pid_t pidfromfile; /* Don't do logging here, since we don't have log() initialised */ if ((fb = fopen(filename, "r"))) { if (fgets(buff, 20, fb) == NULL) { /* log(L_ERROR, "Error reading from pid file %s (%s)", filename, * strerror(errno)); */ } else { pidfromfile = atoi(buff); if (!kill(pidfromfile, 0)) { /* log(L_ERROR, "Server is already running"); */ printf("ircd: daemon is already running\n"); exit(-1); } } fclose(fb); } else if (errno != ENOENT) { /* log(L_ERROR, "Error opening pid file %s", filename); */ } } /* setup_corefile() * * inputs - nothing * output - nothing * side effects - setups corefile to system limits. * -kre */ static void setup_corefile(void) { #ifdef HAVE_SYS_RESOURCE_H struct rlimit rlim; /* resource limits */ /* Set corefilesize to maximum */ if (!getrlimit(RLIMIT_CORE, &rlim)) { rlim.rlim_cur = rlim.rlim_max; setrlimit(RLIMIT_CORE, &rlim); } #endif } #ifdef HAVE_LIBCRYPTO static int always_accept_verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx) { return 1; } #endif /* init_ssl() * * inputs - nothing * output - nothing * side effects - setups SSL context. */ static void ssl_init(void) { #ifdef HAVE_LIBCRYPTO SSL_load_error_strings(); SSLeay_add_ssl_algorithms(); if ((ServerInfo.server_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) { const char *s; fprintf(stderr, "ERROR: Could not initialize the SSL Server context -- %s\n", s = ERR_lib_error_string(ERR_get_error())); ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Server context -- %s\n", s); } SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1); SSL_CTX_set_options(ServerInfo.server_ctx, SSL_OP_TLS_ROLLBACK_BUG|SSL_OP_ALL); SSL_CTX_set_verify(ServerInfo.server_ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, always_accept_verify_cb); if ((ServerInfo.client_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) { const char *s; fprintf(stderr, "ERROR: Could not initialize the SSL Client context -- %s\n", s = ERR_lib_error_string(ERR_get_error())); ilog(LOG_TYPE_IRCD, "ERROR: Could not initialize the SSL Client context -- %s\n", s); } SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1); SSL_CTX_set_options(ServerInfo.client_ctx, SSL_OP_TLS_ROLLBACK_BUG|SSL_OP_ALL); SSL_CTX_set_verify(ServerInfo.client_ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, always_accept_verify_cb); #endif /* HAVE_LIBCRYPTO */ } int main(int argc, char *argv[]) { /* Check to see if the user is running us as root, which is a nono */ if (geteuid() == 0) { fprintf(stderr, "Don't run ircd as root!!!\n"); return -1; } /* Setup corefile size immediately after boot -kre */ setup_corefile(); /* save server boot time right away, so getrusage works correctly */ set_time(); /* It ain't random, but it ought to be a little harder to guess */ init_genrand(SystemTime.tv_sec ^ (SystemTime.tv_usec | (getpid() << 20))); me.localClient = &meLocalUser; dlinkAdd(&me, &me.node, &global_client_list); /* Pointer to beginning of Client list */ /* Initialise the channel capability usage counts... */ init_chcap_usage_counts(); ConfigFileEntry.dpath = DPATH; ConfigFileEntry.configfile = CPATH; /* Server configuration file */ ConfigFileEntry.klinefile = KPATH; /* Server kline file */ ConfigFileEntry.glinefile = GPATH; /* Server gline file */ ConfigFileEntry.xlinefile = XPATH; /* Server xline file */ ConfigFileEntry.dlinefile = DLPATH; /* dline file */ ConfigFileEntry.resvfile = RESVPATH; /* resv file */ myargv = argv; umask(077); /* better safe than sorry --SRB */ parseargs(&argc, &argv, myopts); if (printVersion) { printf("ircd: version %s(%s)\n", ircd_version, serno); exit(EXIT_SUCCESS); } if (chdir(ConfigFileEntry.dpath)) { perror("chdir"); exit(EXIT_FAILURE); } ssl_init(); if (!server_state.foreground) { make_daemon(); close_standard_fds(); /* this needs to be before init_netio()! */ } else print_startup(getpid()); setup_signals(); /* Init the event subsystem */ eventInit(); /* We need this to initialise the fd array before anything else */ fdlist_init(); log_set_file(LOG_TYPE_IRCD, 0, logFileName); check_can_use_v6(); init_netio(); /* This needs to be setup early ! -- adrian */ /* Check if there is pidfile and daemon already running */ check_pidfile(pidFileName); mp_pool_init(); init_dlink_nodes(); init_isupport(); dbuf_init(); hash_init(); init_ip_hash_table(); /* client host ip hash table */ init_host_hash(); /* Host-hashtable. */ client_init(); class_init(); whowas_init(); watch_init(); auth_init(); /* Initialise the auth code */ init_resolver(); /* Needs to be setup before the io loop */ modules_init(); read_conf_files(1); /* cold start init conf files */ init_uid(); initialize_server_capabs(); /* Set up default_server_capabs */ initialize_global_set_options(); channel_init(); read_links_file(); motd_init(); #ifdef HAVE_LIBGEOIP geoip_ctx = GeoIP_new(GEOIP_MEMORY_CACHE); #endif if (EmptyString(ServerInfo.sid)) { ilog(LOG_TYPE_IRCD, "ERROR: No server id specified in serverinfo block."); exit(EXIT_FAILURE); } strlcpy(me.id, ServerInfo.sid, sizeof(me.id)); if (EmptyString(ServerInfo.name)) { ilog(LOG_TYPE_IRCD, "ERROR: No server name specified in serverinfo block."); exit(EXIT_FAILURE); } strlcpy(me.name, ServerInfo.name, sizeof(me.name)); /* serverinfo{} description must exist. If not, error out.*/ if (EmptyString(ServerInfo.description)) { ilog(LOG_TYPE_IRCD, "ERROR: No server description specified in serverinfo block."); exit(EXIT_FAILURE); } strlcpy(me.info, ServerInfo.description, sizeof(me.info)); me.from = &me; me.servptr = &me; me.localClient->lasttime = CurrentTime; me.localClient->since = CurrentTime; me.localClient->firsttime = CurrentTime; SetMe(&me); make_server(&me); hash_add_id(&me); hash_add_client(&me); /* add ourselves to global_serv_list */ dlinkAdd(&me, make_dlink_node(), &global_serv_list); load_kline_database(); load_dline_database(); load_gline_database(); load_xline_database(); load_resv_database(); if (chdir(MODPATH)) { ilog(LOG_TYPE_IRCD, "Could not load core modules. Terminating!"); exit(EXIT_FAILURE); } load_all_modules(1); load_conf_modules(); load_core_modules(1); /* Go back to DPATH after checking to see if we can chdir to MODPATH */ if (chdir(ConfigFileEntry.dpath)) { perror("chdir"); exit(EXIT_FAILURE); } /* * assemble_umode_buffer() has to be called after * reading conf/loading modules. */ assemble_umode_buffer(); write_pidfile(pidFileName); ilog(LOG_TYPE_IRCD, "Server Ready"); eventAddIsh("cleanup_glines", cleanup_glines, NULL, CLEANUP_GLINES_TIME); eventAddIsh("cleanup_tklines", cleanup_tklines, NULL, CLEANUP_TKLINES_TIME); /* We want try_connections to be called as soon as possible now! -- adrian */ /* No, 'cause after a restart it would cause all sorts of nick collides */ eventAddIsh("try_connections", try_connections, NULL, STARTUP_CONNECTIONS_TIME); /* Setup the timeout check. I'll shift it later :) -- adrian */ eventAddIsh("comm_checktimeouts", comm_checktimeouts, NULL, 1); eventAddIsh("save_all_databases", save_all_databases, NULL, DATABASE_UPDATE_TIMEOUT); if (ConfigServerHide.links_delay > 0) eventAddIsh("write_links_file", write_links_file, NULL, ConfigServerHide.links_delay); else ConfigServerHide.links_disabled = 1; if (splitmode) eventAddIsh("check_splitmode", check_splitmode, NULL, 60); io_loop(); return 0; } ircd-hybrid-8.1.13.dfsg.1/src/motd.c0000644000175000017500000003215512263053413015110 0ustar domdom/* * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). * * Copyright (C) 2000 Kevin L. Mitchell * Copyright (C) 2013 by the Hybrid Development Team. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ /*! \file motd.c * \brief Message-of-the-day manipulation implementation. * \version $Id: motd.c 2409 2013-07-19 15:43:53Z michael $ */ #include "stdinc.h" #include "list.h" #include "ircd.h" #include "conf.h" #include "send.h" #include "s_serv.h" #include "numeric.h" #include "client.h" #include "irc_string.h" #include "memory.h" #include "log.h" #include "motd.h" #include "hostmask.h" /** Global list of messages of the day. */ static struct { struct Motd *local; /**< Local MOTD. */ struct Motd *remote; /**< Remote MOTD. */ dlink_list other; /**< MOTDs specified in configuration file. */ dlink_list cachelist; /**< List of MotdCache entries. */ } MotdList; /*! \brief Create a struct Motd and initialize it. * \param hostmask Hostmask (or connection class name) to filter on. * \param path Path to MOTD file. */ static struct Motd * motd_create(const char *hostmask, const char *path) { struct Motd *tmp = MyMalloc(sizeof(struct Motd)); if (EmptyString(hostmask)) tmp->type = MOTD_UNIVERSAL; else if (class_find(hostmask, 1)) tmp->type = MOTD_CLASS; else { switch (parse_netmask(hostmask, &tmp->address, &tmp->addrbits)) { case HM_IPV4: tmp->type = MOTD_IPMASKV4; break; #ifdef IPV6 case HM_IPV6: tmp->type = MOTD_IPMASKV6; break; #endif default: /* HM_HOST */ tmp->type = MOTD_HOSTMASK; break; } } if (hostmask != NULL) tmp->hostmask = xstrdup(hostmask); tmp->path = xstrdup(path); tmp->maxcount = MOTD_MAXLINES; return tmp; } /*! brief\ This function reads a motd out of a file (if needed) and caches it. * If a matching cache entry already exists, reuse it. Otherwise, * allocate and populate a new MotdCache for it. * \param motd Specification for MOTD file. * \return Matching MotdCache entry. */ static struct MotdCache * motd_cache(struct Motd *motd) { FILE *file = NULL; struct MotdCache *cache = NULL; struct stat sb; char line[MOTD_LINESIZE + 2]; /* \r\n */ char *tmp = NULL; unsigned int i = 0; dlink_node *ptr = NULL; assert(motd); assert(motd->path); if (motd->cache) return motd->cache; /* try to find it in the list of cached files... */ DLINK_FOREACH(ptr, MotdList.cachelist.head) { cache = ptr->data; if (!strcmp(cache->path, motd->path) && cache->maxcount == motd->maxcount) { cache->ref++; /* increase reference count... */ motd->cache = cache; /* remember cache... */ return motd->cache; /* return it */ } } /* need the file's modification time */ if (stat(motd->path, &sb) == -1) { ilog(LOG_TYPE_IRCD, "Couldn't stat \"%s\": %s", motd->path, strerror(errno)); return 0; } /* gotta read in the file, now */ if ((file = fopen(motd->path, "r")) == NULL) { ilog(LOG_TYPE_IRCD, "Couldn't open \"%s\": %s", motd->path, strerror(errno)); return 0; } /* Ok, allocate a structure; we'll realloc later to trim memory */ cache = MyMalloc(sizeof(struct MotdCache) + (MOTD_LINESIZE * MOTD_MAXLINES)); cache->ref = 1; cache->path = xstrdup(motd->path); cache->maxcount = motd->maxcount; cache->modtime = *localtime((time_t *)&sb.st_mtime); /* store modtime */ while (cache->count < cache->maxcount && fgets(line, sizeof(line), file)) { /* copy over line, stopping when we overflow or hit line end */ for (tmp = line, i = 0; i < (MOTD_LINESIZE - 1) && *tmp && *tmp != '\r' && *tmp != '\n'; ++tmp, ++i) cache->motd[cache->count][i] = *tmp; cache->motd[cache->count][i] = '\0'; cache->count++; } fclose(file); /* close the file */ /* trim memory usage a little */ motd->cache = MyMalloc(sizeof(struct MotdCache) + (MOTD_LINESIZE * cache->count)); memcpy(motd->cache, cache, sizeof(struct MotdCache) + (MOTD_LINESIZE * cache->count)); MyFree(cache); /* now link it in... */ dlinkAdd(motd->cache, &motd->cache->node, &MotdList.cachelist); return motd->cache; } /*! \brief Clear and dereference the Motd::cache element of \a motd. * If the MotdCache::ref count goes to zero, free it. * \param motd MOTD to uncache. */ static void motd_decache(struct Motd *motd) { struct MotdCache *cache = NULL; assert(motd); if ((cache = motd->cache) == NULL) /* we can be called for records with no cache */ return; motd->cache = NULL; /* zero the cache */ if (--cache->ref == 0) /* reduce reference count... */ { dlinkDelete(&cache->node, &MotdList.cachelist); MyFree(cache->path); /* free path info... */ MyFree(cache); /* very simple for a reason... */ } } /*! \brief Deallocate a MOTD structure. * If it has cached content, uncache it. * \param motd MOTD to destroy. */ static void motd_destroy(struct Motd *motd) { assert(motd); if (motd->cache) /* drop the cache */ motd_decache(motd); MyFree(motd->path); /* we always must have a path */ MyFree(motd->hostmask); MyFree(motd); } /*! \brief Find the first matching MOTD block for a user. * If the user is remote, always use remote MOTD. * Otherwise, if there is a hostmask- or class-based MOTD that matches * the user, use it. * Otherwise, use the local MOTD. * \param client_p Client to find MOTD for. * \return Pointer to first matching MOTD for the client. */ static struct Motd * motd_lookup(struct Client *client_p) { dlink_node *ptr = NULL; const struct ClassItem *class = NULL; assert(client_p); if (!MyClient(client_p)) /* not my user, always return remote motd */ return MotdList.remote; class = get_class_ptr(&client_p->localClient->confs); assert(class); /* check the motd blocks first */ DLINK_FOREACH(ptr, MotdList.other.head) { struct Motd *motd = ptr->data; switch (motd->type) { case MOTD_CLASS: if (!match(motd->hostmask, class->name)) return motd; break; case MOTD_HOSTMASK: if (!match(motd->hostmask, client_p->host)) return motd; break; case MOTD_IPMASKV4: if (client_p->localClient->aftype == AF_INET) if (match_ipv4(&client_p->localClient->ip, &motd->address, motd->addrbits)) return motd; break; #ifdef IPV6 case MOTD_IPMASKV6: if (client_p->localClient->aftype == AF_INET6) if (match_ipv6(&client_p->localClient->ip, &motd->address, motd->addrbits)) return motd; break; #endif default: break; } } return MotdList.local; /* Ok, return the default motd */ } /*! \brief Send the content of a MotdCache to a user. * If \a cache is NULL, simply send ERR_NOMOTD to the client. * \param source_p Client to send MOTD to. * \param cache MOTD body to send to client. */ static void motd_forward(struct Client *source_p, const struct MotdCache *cache) { unsigned int i = 0; const char *from = ID_or_name(&me, source_p->from); const char *to = ID_or_name(source_p, source_p->from); assert(source_p); if (!cache) /* no motd to send */ { sendto_one(source_p, form_str(ERR_NOMOTD), from, to); return; } /* send the motd */ sendto_one(source_p, form_str(RPL_MOTDSTART), from, to, me.name); for (; i < cache->count; ++i) sendto_one(source_p, form_str(RPL_MOTD), from, to, cache->motd[i]); sendto_one(source_p, form_str(RPL_ENDOFMOTD), from, to); } /*! \brief Find the MOTD for a client and send it. * \param client_p Client being greeted. */ void motd_send(struct Client *client_p) { assert(client_p); motd_forward(client_p, motd_cache(motd_lookup(client_p))); } /*! \brief Send the signon MOTD to a user. * If FEAT_NODEFAULTMOTD is true and a matching MOTD exists for the * user, direct the client to type /MOTD to read it. Otherwise, call * motd_forward() for the user. * \param source_p Client that has just connected. */ void motd_signon(struct Client *source_p) { const struct MotdCache *cache = motd_cache(motd_lookup(source_p)); if (!ConfigFileEntry.short_motd || !cache) motd_forward(source_p, cache); else { sendto_one(source_p, ":%s NOTICE %s :*** Notice -- motd was last changed at %d/%d/%d %d:%02d", me.name, source_p->name, cache->modtime.tm_year + 1900, cache->modtime.tm_mon + 1, cache->modtime.tm_mday, cache->modtime.tm_hour, cache->modtime.tm_min); sendto_one(source_p, ":%s NOTICE %s :*** Notice -- Please read the motd if you haven't " "read it", me.name, source_p->name); sendto_one(source_p, form_str(RPL_MOTDSTART), me.name, source_p->name, me.name); sendto_one(source_p, form_str(RPL_MOTD), me.name, source_p->name, "*** This is the short motd ***"); sendto_one(source_p, form_str(RPL_ENDOFMOTD), me.name, source_p->name); } } /*! \brief Clear all cached MOTD bodies. * The local and remote MOTDs are re-cached immediately. */ void motd_recache(void) { dlink_node *ptr = NULL; motd_decache(MotdList.local); /* decache local and remote MOTDs */ motd_decache(MotdList.remote); DLINK_FOREACH(ptr, MotdList.other.head) /* now all the others */ motd_decache(ptr->data); /* now recache local and remote MOTDs */ motd_cache(MotdList.local); motd_cache(MotdList.remote); } /*! \brief Re-cache the local and remote MOTDs. * If they already exist, they are deallocated first. */ void motd_init(void) { if (MotdList.local) /* destroy old local... */ motd_destroy(MotdList.local); MotdList.local = motd_create(NULL, MPATH); motd_cache(MotdList.local); /* init local and cache it */ if (MotdList.remote) /* destroy old remote... */ motd_destroy(MotdList.remote); MotdList.remote = motd_create(NULL, MPATH); motd_cache(MotdList.remote); /* init remote and cache it */ } /* \brief Add a new MOTD. * \param hostmask Hostmask (or connection class name) to send this to. * \param path Pathname of file to send. */ void motd_add(const char *hostmask, const char *path) { struct Motd *motd = motd_create(hostmask, path); /* create the motd */ dlinkAdd(motd, &motd->node, &MotdList.other); } /*! \brief Clear out all MOTDs. * Compared to motd_recache(), this destroys all hostmask- or * class-based MOTDs rather than simply uncaching them. * Re-cache the local and remote MOTDs. */ void motd_clear(void) { dlink_node *ptr = NULL, *ptr_next = NULL; motd_decache(MotdList.local); /* decache local and remote MOTDs */ motd_decache(MotdList.remote); DLINK_FOREACH_SAFE(ptr, ptr_next, MotdList.other.head) /* destroy other MOTDs */ { dlinkDelete(ptr, &MotdList.other); motd_destroy(ptr->data); } /* now recache local and remote MOTDs */ motd_cache(MotdList.local); motd_cache(MotdList.remote); } /*! \brief Report list of non-default MOTDs. * \param source_p Client requesting statistics. */ void motd_report(struct Client *source_p) { const dlink_node *ptr = NULL; DLINK_FOREACH(ptr, MotdList.other.head) { const struct Motd *motd = ptr->data; sendto_one(source_p, form_str(RPL_STATSTLINE), me.name, source_p->name, motd->hostmask, motd->path); } } /*! \brief Report MOTD memory usage to a client. * \param source_p Client requesting memory usage. */ void motd_memory_count(struct Client *source_p) { const dlink_node *ptr = NULL; unsigned int mt = 0; /* motd count */ unsigned int mtc = 0; /* motd cache count */ size_t mtm = 0; /* memory consumed by motd */ size_t mtcm = 0; /* memory consumed by motd cache */ if (MotdList.local) { mt++; mtm += sizeof(struct Motd); mtm += MotdList.local->path ? (strlen(MotdList.local->path) + 1) : 0; } if (MotdList.remote) { mt++; mtm += sizeof(struct Motd); mtm += MotdList.remote->path ? (strlen(MotdList.remote->path) + 1) : 0; } DLINK_FOREACH(ptr, MotdList.other.head) { const struct Motd *motd = ptr->data; mt++; mtm += sizeof(struct Motd); mtm += motd->path ? (strlen(motd->path) + 1) : 0; } DLINK_FOREACH(ptr, MotdList.cachelist.head) { const struct MotdCache *cache = ptr->data; mtc++; mtcm += sizeof(struct MotdCache) + (MOTD_LINESIZE * (cache->count - 1)); } sendto_one(source_p, ":%s %d %s z :Motds %u(%u) Cache %u(%u)", me.name, RPL_STATSDEBUG, source_p->name, mt, mtm, mtc, mtcm); } ircd-hybrid-8.1.13.dfsg.1/COPYING0000644000175000017500000004321112263053414014241 0ustar domdom# $Id: COPYING 917 2007-11-07 23:53:58Z michael $ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ircd-hybrid-8.1.13.dfsg.1/aclocal.m40000644000175000017500000012707712263053414015063 0ustar domdom# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_define_dir.m4]) m4_include([m4/argz.m4]) m4_include([m4/ax_append_compile_flags.m4]) m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_check_openssl.m4]) m4_include([m4/gcc_stack_protect.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([acinclude.m4]) ircd-hybrid-8.1.13.dfsg.1/help/0000755000175000017500000000000012263053456014143 5ustar domdomircd-hybrid-8.1.13.dfsg.1/help/user0000644000175000017500000000045112263053413015035 0ustar domdomUSER : USER is used during registration to set your gecos and to set your username if the server cannot get a valid ident response. The second and third fields are not used, but there must be something in them. The reason is backwards compatibility ircd-hybrid-8.1.13.dfsg.1/help/resv0000644000175000017500000000043312263053413015036 0ustar domdomRESV : -- RESV a channel or nick Will create a resv for the given channel/nick, stopping local users from joining the channel, or using the nick. Will not affect remote clients. If the oper is an admin, they may create a wildcard resv, for example: clones* ircd-hybrid-8.1.13.dfsg.1/help/dline0000644000175000017500000000055312263053413015155 0ustar domdomDLINE